aboutsummaryrefslogtreecommitdiffstats
path: root/doc/nasmdoc.src
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2017-03-08 01:26:40 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2017-03-08 01:26:40 -0800
commitb2047cbb9885dfee037311ff66ef76296b99aecc (patch)
tree88c1c731de7c941c8defe6ae3fb3f5fe5e105f28 /doc/nasmdoc.src
parent38373e8f1c5628f05d428cbb434cd62689827857 (diff)
downloadnasm-b2047cbb9885dfee037311ff66ef76296b99aecc.tar.gz
nasm-b2047cbb9885dfee037311ff66ef76296b99aecc.tar.xz
nasm-b2047cbb9885dfee037311ff66ef76296b99aecc.zip
Make -Werror controllable on a per-warning-class basis
Make -Werror possible to control on a per-warning-class basis. While I was fixing up that code anyway, merge the handling of the -w, -W and [warning] argument and directives. Furthermore, make *all* warnings suppressible; any warning that isn't categorized now belong to category "other". However, for cleanliness sake an "other" option does not get listed in the warning messages. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'doc/nasmdoc.src')
-rw-r--r--doc/nasmdoc.src61
1 files changed, 48 insertions, 13 deletions
diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src
index d2e9bd24..0df4911f 100644
--- a/doc/nasmdoc.src
+++ b/doc/nasmdoc.src
@@ -77,6 +77,8 @@
\IR{-u} \c{-u} option
\IR{-v} \c{-v} option
\IR{-W} \c{-W} option
+\IR{-Werror} \c{-Werror} option
+\IR{-Wno-error} \c{-Wno-error} option
\IR{-w} \c{-w} option
\IR{-y} \c{-y} option
\IR{-Z} \c{-Z} option
@@ -910,7 +912,10 @@ name, for example \c{orphan-labels}; you can enable warnings of
this class by the command-line option \c{-w+orphan-labels} and
disable it by \c{-w-orphan-labels}.
-The \i{suppressible warning} classes are:
+The current \i{warning classes} are:
+
+\b \i\c{other} specifies any warning not otherwise specified in any
+class.
\b \i\c{macro-params} covers warnings about \i{multi-line macros}
being invoked with the wrong number of parameters. This warning
@@ -969,22 +974,36 @@ to limitations in the output format.
indicate a mistake in the source code. Currently only the MASM
\c{PTR} keyword is recognized.
-\b \i\c{error} causes warnings to be treated as errors. Disabled by
-default.
+\b \i\c{bad-pragma} warns about a malformed or otherwise unparsable
+\c{%pragma} directive. Disabled by default.
-\b \i\c{all} is an alias for \e{all} suppressible warning classes (not
-including \c{error}). Thus, \c{-w+all} enables all available warnings.
+\b \i\c{unknown-pragma} warns about an unknown \c{%pragma} directive.
+This is not yet implemented. Disabled by default.
-In addition, you can control warnings in the source code itself, using
-the \i\c{[warning]} directive.
-Warning classes may be enabled with \i\c{[warning +warning-name]},
-disabled with \i\c{[warning -warning-name]} or reset to their
-original value with \i\c{[warning *warning-name]}. No "user form"
-(without the brackets) exists.
+\b \i\c{not-my-pragma} warns about a \c{%pragma} directive which is
+not applicable to this particular assembly session. This is not yet
+implemented. Disabled by default.
+
+\b \i\c{unknown-warning} warns about a \c{-w} or \c{-W} option or a
+\c{[WARNING]} directive that contains an unknown warning name or is
+otherwise not possible to process.
+
+\b \i\c{all} is an alias for \e{all} suppressible warning classes.
+Thus, \c{-w+all} enables all available warnings, and \c{-w-all}
+disables warnings entirely (since NASM 2.13).
Since version 2.00, NASM has also supported the gcc-like syntax
-\c{-Wwarning} and \c{-Wno-warning} instead of \c{-w+warning} and
-\c{-w-warning}, respectively.
+\c{-Wwarning-class} and \c{-Wno-warning-class} instead of \c{-w+warning-class} and
+\c{-w-warning-class}, respectively; both syntaxes work identically.
+
+The option \c{-w+error} or \i\c{-Werror} can be used to treat warnings
+as errors. This can be controlled on a per warning class basis
+(\c{-w+error=}\e{warning-class}); if no \e{warning-class} is specified
+NASM treats it as \c{-w+error=all}; the same applies to \c{-w-error}
+or \i\c{-Wno-error}, of course.
+
+In addition, you can control warnings in the source code itself, using
+the \i\c{[WARNING]} directive. See \k{asmdir-warning}.
\S{opt-v} The \i\c{-v} Option: Display \i{Version} Info
@@ -4776,6 +4795,22 @@ has avoided the use of the brackeded primitive form, (\c{[FLOAT]}).
value can be saved away and invoked later to restore the setting.
+\H{asmdir-warning} \i\c{[WARNING]}: Enable or disable warnings
+
+The \c{[WARNING]} directive can be used to enable or disable classes
+of warnings in the same way as the \c{-w} option, see \k{opt-w} for
+more details about warning classes.
+
+Warning classes may be enabled with \c{[warning +]\e{warning-class}\c{]}, disabled
+with \c{[warning -}\e{warning-class}\c{]}, or reset to their original value (as
+specified on the command line) with \c{[warning *}\e{warning-class}{]}.
+
+The \c{[WARNING]} directive also accepts the \c{all}, \c{error} and
+\c{error=}\e{warning-class} specifiers.
+
+No "user form" (without the brackets) currently exists.
+
+
\C{outfmt} \i{Output Formats}
NASM is a portable assembler, designed to be able to compile on any