Mercurial > octave-nkf
diff doc/interpreter/errors.txi @ 15524:15628a84a4fa stable
Document form of warning IDs is NAMESPACE:WARNING-NAME (bug #37559)
* errors.txi: Add explanation of warning ID form to documentation.
Correct example code to properly use warning IDs.
* error.cc (Fwarning): Document form of warning ID in warning()
docstring.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 15 Oct 2012 07:18:31 -0700 |
parents | 72c96de7a403 |
children | ae43fc2ddcac 6a4e79110857 |
line wrap: on
line diff
--- a/doc/interpreter/errors.txi Mon Oct 15 08:34:33 2012 -0400 +++ b/doc/interpreter/errors.txi Mon Oct 15 07:18:31 2012 -0700 @@ -296,7 +296,10 @@ If a warning has such an ID the user can enable and disable this warning as will be described in the next section. To assign an ID to a warning, simply call @code{warning} with two string arguments, where the first -is the identification string, and the second is the actual warning. +is the identification string, and the second is the actual warning. Note +that warning IDs are in the format "NAMESPACE:WARNING-NAME". The namespace +"Octave" is used for Octave's own warnings. Any other string is available +as a namespace for user's own warnings. @DOCSTRING(warning) @@ -315,7 +318,7 @@ @example @group -warning ("non-negative-variable", +warning ("example:non-negative-variable", "'a' must be non-negative. Setting 'a' to zero."); @end group @end example @@ -325,8 +328,8 @@ @example @group -warning ("off", "non-negative-variable"); -warning ("non-negative-variable", +warning ("off", "example:non-negative-variable"); +warning ("example:non-negative-variable", "'a' must be non-negative. Setting 'a' to zero."); @end group @end example