diff options
Diffstat (limited to 'doc/nasmdoc.src')
-rw-r--r-- | doc/nasmdoc.src | 57 |
1 files changed, 44 insertions, 13 deletions
diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 98826097..23c03907 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -852,29 +852,46 @@ disable it by \c{-w-orphan-labels}. The \i{suppressible warning} classes are: +\b \i\c{error} decides if warnings should be treated as errors. +It is disabled by default. + \b \i\c{macro-params} covers warnings about \i{multi-line macros} being invoked with the wrong number of parameters. This warning class is enabled by default; see \k{mlmacover} for an example of why you might want to disable it. \b \i\c{macro-selfref} warns if a macro references itself. This -warning class is enabled by default. +warning class is disabled by default. + +\b\i\c{macro-defaults} warns when a macro has more default +parameters than optional parameters. This warning class +is enabled by default; see \k{mlmacdef} for why you might want to disable it. \b \i\c{orphan-labels} covers warnings about source lines which contain no instruction but define a label without a trailing colon. -NASM does not warn about this somewhat obscure condition by default; -see \k{syntax} for an example of why you might want it to. +NASM warns about this somewhat obscure condition by default; +see \k{syntax} for more information. \b \i\c{number-overflow} covers warnings about numeric constants which -don't fit in 32 bits (for example, it's easy to type one too many Fs -and produce \c{0x7ffffffff} by mistake). This warning class is -enabled by default. +don't fit in 64 bits. This warning class is enabled by default. \b \i\c{gnu-elf-extensions} warns if 8-bit or 16-bit relocations are used in \c{-f elf} format. The GNU extensions allow this. -This warning class is enabled by default. +This warning class is disabled by default. + +\b \i\c{float-overflow} warns about floating point overflow. +Enabled by default. + +\b \i\c{float-denorm} warns about floating point denormals. +Disabled by default. + +\b \i\c{float-underflow} warns about floating point underflow. +Disabled by default. -\b In addition, you can set warning classes across sections. +\b \i\c{float-toolong} warns about too many digits in floating-point numbers. +Enabled by default. + +In addition, you can set warning classes across sections. 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" @@ -2480,6 +2497,19 @@ then it could be called with between one and three parameters, and specified by the macro call, would default to \c{eax}, and \c{%3} if not specified would default to \c{[ebx+2]}. +You can provide extra information to a macro by providing +too many default parameters: + +\c %macro quux 1 something + +This will trigger a warning by default; see \k{opt-w} for +more information. +When \c{quux} is invoked, it receives not one but two parameters. +\c{something} can be referred to as \c{%2}. The difference +between passing \c{something} this way and writing \c{something} +in the macro body is that with this way \c{something} is evaluated +when the macro is defined, not when it is expanded. + You may omit parameter defaults from the macro definition, in which case the parameter default is taken to be blank. This can be useful for macros which can take a variable number of parameters, since the @@ -2499,11 +2529,12 @@ default parameters. Examples of this usage are shown in \k{rotate}. \S{percent0} \i\c{%0}: \I{counting macro parameters}Macro Parameter Counter -For a macro which can take a variable number of parameters, the -parameter reference \c{%0} will return a numeric constant giving the -number of parameters passed to the macro. This can be used as an -argument to \c{%rep} (see \k{rep}) in order to iterate through all -the parameters of a macro. Examples are given in \k{rotate}. +The parameter reference \c{%0} will return a numeric constant giving the +number of parameters received, that is, if \c{%0} is n then \c{%}n is the +last parameter. \c{%0} is mostly useful for macros that can take a variable +number of parameters. It can be used as an argument to \c{%rep} +(see \k{rep}) in order to iterate through all the parameters of a macro. +Examples are given in \k{rotate}. \S{rotate} \i\c{%rotate}: \i{Rotating Macro Parameters} |