Skip to content

warning

builtin · libnexusinterp/corefcn/error-proprietary.cc

: warning (template, …)
: warning (id, template, …)
: warning ("on", id)
: warning ("off", id)
: warning ("error", id)
: warning ("query", id)
: state = warning (…)
: warning (state)

Issue a warning or inspect and change the warning states.

With a template (and optional identifier) the warning message is printed, preceded by ‘warning:’, and followed by the list of calling functions. A message ending in a newline omits that list. The message and identifier are also recorded for lastwarn.

"on", "off" and "error" set the state of the warning id (or of "all" warnings; the names "backtrace", "verbose", "debug" and "quiet" select display options). An output returns the previous state, which can be passed back to warning. A third argument "local" restores the state when the calling function returns. "query" reports a state, or lists all non-default states when no id is given.