These are the warning classes currently defined by NASM for the purpose of enabling, disabling and promoting to error. See section 2.1.26 and section 7.13.
all
: all possible warnings
all
is an group alias for all warning classes.
Thus, -w+all
enables all available warnings, and
-w-all
disables warnings entirely (since NASM 2.13).
bad-pragma
: malformed %pragma
bad-pragma
is a backwards compatibility alias for
pragma-bad
.
bnd
: invalid BND
prefix
bnd
is a backwards compatibility alias for
prefix-bnd
.
db-empty
: no operand for data declaration
db-empty
warns about a D
x declaration
with no operands, producing no output. This is permitted, but often
indicative of an error. See section
3.2.1.
Enabled by default.
ea
: all ea-
warnings
ea
is a group alias for all warning classes prefixed by
ea-
; currently ea-absolute
and
ea-dispsize
.
ea-absolute
: absolute address cannot be RIP-relative
ea-absolute
warns that an address that is inherently
absolute cannot be generated with RIP-relative encoding using
REL
, see section
7.2.1.
Enabled by default.
ea-dispsize
: displacement size ignored on absolute address
ea-dispsize
warns that NASM does not support generating
displacements for inherently absolute addresses that do not match the
address size of the instruction.
Enabled by default.
environment
: nonexistent environment variable
environment
is a backwards compatibility alias for
pp-environment
.
float
: all float-
warnings
float
is a group alias for all warning classes prefixed by
float-
; currently float-denorm
,
float-overflow
, float-toolong
,
float-underflow
.
float-denorm
: floating point denormal
float-denorm
warns about denormal floating point constants.
Disabled by default.
float-overflow
: floating point overflow
float-overflow
warns about floating point underflow.
Enabled by default.
float-toolong
: too many digits in floating-point number
float-toolong
warns about too many digits in floating-point
numbers.
Enabled by default.
float-underflow
: floating point underflow
float-underflow
warns about floating point underflow (a
nonzero constant rounded to zero.)
Disabled by default.
forward
: forward reference may have unpredictable results
forward
warns that a forward reference is used which may
have unpredictable results, notably in a RESB
–type
pseudo-instruction. These would be critical expressions (see
section 3.8) but are permitted in a
handful of cases for compatibility with older versions of NASM. This
warning should be treated as a severe programming error as the code could
break at any time for any number of reasons.
Enabled by default.
hle
: invalid HLE prefix
hle
is a backwards compatibility alias for
prefix-hle
.
label
: all label-
warnings
label
is a group alias for all warning classes prefixed by
label-
; currently label-orphan
,
label-redef
, label-redef-late
.
label-orphan
: labels alone on lines without trailing
:
label-orphan
warns about source lines which contain no
instruction but define a label without a trailing colon. This is most
likely indicative of a typo, but is technically correct NASM syntax (see
section 3.1.)
Enabled by default.
label-redef
: label redefined to an identical value
label-redef
warns if a label is defined more than once, but
the value is identical. It is an unconditional error to define the same
label more than once to different values.
Disabled by default.
label-redef-late
: label (re)defined during code generation
label-redef-late
the value of a label changed during the
final, code-generation pass. This may be the result of strange use of the
preprocessor. This is very likely to produce incorrect code and may end up
being an unconditional error in a future version of NASM.
Enabled and promoted to error by default.
lock
: LOCK
prefix on unlockable instruction
lock
is a backwards compatibility alias for
prefix-lock-error
.
macro-def-case-single
: single-line macro defined both case
sensitive and insensitive
macro-def-case-single
is a backwards compatibility alias
for pp-macro-def-case-single
.
macro-def-greedy-single
: single-line macro
macro-def-greedy-single
is a backwards compatibility alias
for pp-macro-def-greedy-single
.
macro-def-param-single
: single-line macro defined with and
without parameters
macro-def-param-single
is a backwards compatibility alias
for pp-macro-def-param-single
.
macro-defaults
: macros with more default than optional
parameters
macro-defaults
is a backwards compatibility alias for
pp-macro-defaults
.
macro-params-legacy
: improperly calling multi-line macro
for legacy support
macro-params-legacy
is a backwards compatibility alias for
pp-macro-params-legacy
.
macro-params-multi
: multi-line macro calls with wrong
parameter count
macro-params-multi
is a backwards compatibility alias for
pp-macro-params-multi
.
macro-params-single
: single-line macro calls with wrong
parameter count
macro-params-single
is a backwards compatibility alias for
pp-macro-params-single
.
negative-rep
: regative %rep
count
negative-rep
is a backwards compatibility alias for
pp-rep-negative
.
not-my-pragma
: %pragma
not applicable to this
compilation
not-my-pragma
is a backwards compatibility alias for
pragma-na
.
number-overflow
: numeric constant does not fit
number-overflow
covers warnings about numeric constants
which don't fit in 64 bits.
Enabled by default.
obsolete
: all obsolete-
warnings
obsolete
is a group alias for all warning classes prefixed
by obsolete-
; currently obsolete-nop
,
obsolete-removed
, obsolete-valid
.
obsolete-nop
: instruction obsolete and is a noop on the
target CPU
obsolete-nop
warns for an instruction which has been
removed from the architecture, but has been architecturally defined to be a
noop for future CPUs.
Enabled by default.
obsolete-removed
: instruction obsolete and removed on the
target CPU
obsolete-removed
warns for an instruction which has been
removed from the architecture, and is no longer included in the CPU
definition given in the [CPU]
directive, for example
POP CS
, the opcode for which, 0Fh
, instead is an
opcode prefix on CPUs newer than the first generation 8086.
Enabled by default.
obsolete-valid
: instruction obsolete but valid on the
target CPU
obsolete-valid
warns for an instruction which has been
removed from the architecture, but is still valid on the specific CPU given
in the CPU
directive. Code using these instructions is most
likely not forward compatible.
Enabled by default.
orphan-labels
: labels alone on lines without trailing
:
orphan-labels
is a backwards compatibility alias for
label-orphan
.
other
: any warning not specifically mentioned above
other
specifies any warning not included in any specific
warning class.
Enabled by default.
phase
: phase error during stabilization
phase
warns about symbols having changed values during the
second-to-last assembly pass. This is not inherently fatal, but may be a
source of bugs.
Disabled by default.
pp
: all pp-
warnings
pp
is a group alias for all warning classes prefixed by
pp-
; currently pp-else-elif
,
pp-else-else
, pp-empty-braces
,
pp-environment
, pp-macro-def-case-single
,
pp-macro-def-greedy-single
,
pp-macro-def-param-single
, pp-macro-defaults
,
pp-macro-params-legacy
, pp-macro-params-multi
,
pp-macro-params-single
, pp-macro-redef-multi
,
pp-open-braces
, pp-open-brackets
,
pp-open-string
, pp-rep-negative
,
pp-sel-range
, pp-trailing
.
pp-else
: all pp-else-
warnings
pp-else
is a group alias for all warning classes prefixed
by pp-else-
; currently pp-else-elif
and
pp-else-else
.
pp-else-elif
: %elif
after %else
pp-else-elif
warns that an %elif
–type
directive was encountered after %else
has already been
encounted. As a result, the content of the %elif
will never be
expanded.
Enabled by default.
pp-else-else
: %else
after %else
pp-else-else
warns that a second %else
clause
was found for the same %if
statement. The content of this
%else
clause will never be expanded.
Enabled by default.
pp-empty-braces
: empty %{}
construct
pp-empty-braces
warns that an empty %{}
was
encountered. This expands to a single %
character, which is
normally the %
arithmetic operator.
Enabled by default.
pp-environment
: nonexistent environment variable
pp-environment
warns if a nonexistent environment variable
is accessed using the %!
preprocessor construct (see
section 4.13.2.) Such
environment variables are treated as empty (with this warning issued)
starting in NASM 2.15; earlier versions of NASM would treat this as an
error.
Enabled by default.
pp-macro
: all pp-macro-
warnings
pp-macro
is a group alias for all warning classes prefixed
by pp-macro-
; currently pp-macro-def-case-single
,
pp-macro-def-greedy-single
,
pp-macro-def-param-single
, pp-macro-defaults
,
pp-macro-params-legacy
, pp-macro-params-multi
,
pp-macro-params-single
, pp-macro-redef-multi
.
pp-macro-def
: all pp-macro-def-
warnings
pp-macro-def
is a group alias for all warning classes
prefixed by pp-macro-def-
; currently
pp-macro-def-case-single
,
pp-macro-def-greedy-single
,
pp-macro-def-param-single
.
pp-macro-def-case-single
: single-line macro defined both
case sensitive and insensitive
pp-macro-def-case-single
warns when a single-line macro is
defined both case sensitive and case insensitive. The new macro definition
will override (shadow) the original one, although the original macro is not
deleted, and will be re-exposed if the new macro is deleted with
%undef
, or, if the original macro is the case insensitive one,
the macro call is done with a different case.
Enabled by default.
pp-macro-def-greedy-single
: single-line macro
pp-macro-def-greedy-single
definition shadows greedy macro
warns when a single-line macro is defined which would match a previously
existing greedy definition. The new macro definition will override (shadow)
the original one, although the original macro is not deleted, and will be
re-exposed if the new macro is deleted with %undef
, and will
be invoked if called with a parameter count that does not match the new
definition.
Enabled by default.
pp-macro-def-param-single
: single-line macro defined with
and without parameters
pp-macro-def-param-single
warns if the same single-line
macro is defined with and without parameters. The new macro definition will
override (shadow) the original one, although the original macro is not
deleted, and will be re-exposed if the new macro is deleted with
%undef
.
Enabled and promoted to error by default.
pp-macro-defaults
: macros with more default than optional
parameters
pp-macro-defaults
warns when a macro has more default
parameters than optional parameters. See
section 4.5.5 for why might want
to disable this warning.
Enabled by default.
pp-macro-params
: all pp-macro-params-
warnings
pp-macro-params
is a group alias for all warning classes
prefixed by pp-macro-params-
; currently
pp-macro-params-legacy
, pp-macro-params-multi
,
pp-macro-params-single
.
pp-macro-params-legacy
: improperly calling multi-line
macro for legacy support
pp-macro-params-legacy
warns about multi-line macros being
invoked with the wrong number of parameters, but for bug-compatibility with
NASM versions older than 2.15, NASM tried to fix up the parameters to match
the legacy behavior and call the macro anyway. This can happen in certain
cases where there are empty arguments without braces, sometimes as a result
of macro expansion.
The legacy behavior is quite strange and highly context-dependent, and can be disabled with:
%pragma preproc sane_empty_expansion true
It is highly recommended to use this option in new code.
Enabled by default.
pp-macro-params-multi
: multi-line macro calls with wrong
parameter count
pp-macro-params-multi
warns about multi-line macros being
invoked with the wrong number of parameters. See
section 4.5.1 for an example of
why you might want to disable this warning.
Enabled by default.
pp-macro-params-single
: single-line macro calls with wrong
parameter count
pp-macro-params-single
warns about single-line macros being
invoked with the wrong number of parameters.
Enabled by default.
pp-macro-redef-multi
: redefining multi-line macro
pp-macro-redef-multi
warns that a multi-line macro is being
redefined, without first removing the old definition with
%unmacro
.
Enabled by default.
pp-open
: all pp-open-
warnings
pp-open
is a group alias for all warning classes prefixed
by pp-open-
; currently pp-open-braces
,
pp-open-brackets
, pp-open-string
.
pp-open-braces
: unterminated %{...}
pp-open-braces
warns that a preprocessor parameter enclosed
in braces %{...}
lacks the terminating }
character.
Enabled by default.
pp-open-brackets
: unterminated %[...]
pp-open-brackets
warns that a preprocessor
%[...]
construct lacks the terminating ]
character.
Enabled by default.
pp-open-string
: unterminated string
pp-open-string
warns that a quoted string without a closing
quotation mark was encountered during preprocessing.
Enabled by default.
pp-rep-negative
: regative %rep
count
pp-rep-negative
warns about a negative count given to the
%rep
preprocessor directive.
Enabled by default.
pp-sel-range
: %sel()
argument out of range
pp-sel-range
warns that the %sel()
preprocessor function was passed a value less than 1 or larger than the
number of available arguments.
Enabled by default.
pp-trailing
: trailing garbage ignored
pp-trailing
warns that the preprocessor encountered
additional text where no such text was expected. This can sometimes be the
result of an incorrectly written expression, or arguments that are
inadvertently separated.
Enabled by default.
pragma
: all pragma-
warnings
pragma
is a group alias for all warning classes prefixed by
pragma-
; currently pragma-bad
,
pragma-empty
, pragma-na
,
pragma-unknown
.
pragma-bad
: malformed %pragma
pragma-bad
warns about a malformed or otherwise unparsable
%pragma
directive.
Disabled by default.
pragma-empty
: empty %pragma
directive
pragma-empty
warns about a %pragma
directive
containing nothing. This is treated identically to
%pragma ignore
except for this optional warning.
Disabled by default.
pragma-na
: %pragma
not applicable to this
compilation
pragma-na
warns about a %pragma
directive
which is not applicable to this particular assembly session. This is not
yet implemented.
Disabled by default.
pragma-unknown
: unknown %pragma
facility or
directive
pragma-unknown
warns about an unknown %pragma
directive. This is not yet implemented for most cases.
Disabled by default.
prefix
: all prefix-
warnings
prefix
is a group alias for all warning classes prefixed by
prefix-
; currently prefix-bnd
,
prefix-hle
, prefix-lock-error
,
prefix-lock-xchg
, prefix-opsize
,
prefix-seg
.
prefix-bnd
: invalid BND
prefix
prefix-bnd
warns about ineffective use of the
BND
prefix when the JMP
instruction is converted
to the SHORT
form. This should be extremely rare since the
short JMP
only is applicable to jumps inside the same module,
but if it is legitimate, it may be necessary to use
bnd jmp dword
.
Enabled by default.
prefix-hle
: invalid HLE prefix
prefix-hle
warns about invalid use of the HLE
XACQUIRE
or XRELEASE
prefixes.
Enabled by default.
prefix-lock
: all prefix-lock-
warnings
prefix-lock
is a group alias for all warning classes
prefixed by prefix-lock-
; currently
prefix-lock-error
and prefix-lock-xchg
.
prefix-lock-error
: LOCK
prefix on unlockable
instruction
prefix-lock-error
warns about LOCK
prefixes on
unlockable instructions.
Enabled by default.
prefix-lock-xchg
: superfluous LOCK
prefix on
XCHG
instruction
prefix-lock-xchg
warns about a LOCK
prefix
added to an XCHG
instruction. The XCHG
instruction is always locking, and so this prefix is not
necessary; however, NASM will generate it if explicitly provided by the
user, so this warning indicates that suboptimal code is being generated.
Enabled by default.
prefix-opsize
: invalid operand size prefix
prefix-opsize
warns that an operand prefix
(o16
, o32
, o64
, osp
)
invalid for the specified instruction has been specified. The operand
prefix will be ignored by the assembler.
Enabled by default.
prefix-seg
: segment prefix ignored in 64-bit mode
prefix-seg
warns that an es
, cs
,
ss
or ds
segment override prefix has no effect in
64-bit mode. The prefix will still be generated as requested.
Enabled by default.
ptr
: non-NASM keyword used in other assemblers
ptr
warns about keywords used in other assemblers that
might indicate a mistake in the source code. Currently only the MASM
PTR
keyword is recognized. If (limited) MASM compatibility is
desired, the %use masm
macro package is available, see
section 6.5; however, carefully
note the caveats listed.
Enabled by default.
regsize
: register size specification ignored
regsize
warns about a register with implicit size (such as
EAX
, which is always 32 bits) been given an explicit size
specification which is inconsistent with the size of the named register,
e.g. WORD EAX
. DWORD EAX
or WORD AX
are permitted, and do not trigger this warning. Some registers which do
not imply a specific size, such as K0
, may need this
specification unless the instruction itself implies the instruction size:
KMOVW K0,[foo] ; Permitted, KMOVW implies 16 bits KMOV WORD K0,[foo] ; Permitted, WORD K0 specifies instruction size KMOV K0,WORD [foo] ; Permitted, WORD [foo] specifies instruction size KMOV K0,[foo] ; Not permitted, instruction size ambiguous
Enabled by default.
reloc
: all reloc-
warnings
reloc
is a group alias for all warning classes prefixed by
reloc-
; currently reloc-abs-byte
,
reloc-abs-dword
, reloc-abs-qword
,
reloc-abs-word
, reloc-rel-byte
,
reloc-rel-dword
, reloc-rel-qword
,
reloc-rel-word
.
reloc-abs
: all reloc-abs-
warnings
reloc-abs
is a group alias for all warning classes prefixed
by reloc-abs-
; currently reloc-abs-byte
,
reloc-abs-dword
, reloc-abs-qword
,
reloc-abs-word
.
reloc-abs-byte
: 8-bit absolute section-crossing relocation
reloc-abs-byte
warns that an 8-bit absolute relocation that
could not be resolved at assembly time was generated in the output format.
This is usually normal, but may not be handled by all possible target
environments
Disabled by default.
reloc-abs-dword
: 32-bit absolute section-crossing
relocation
reloc-abs-dword
warns that a 32-bit absolute relocation
that could not be resolved at assembly time was generated in the output
format. This is usually normal, but may not be handled by all possible
target environments
Disabled by default.
reloc-abs-qword
: 64-bit absolute section-crossing
relocation
reloc-abs-qword
warns that a 64-bit absolute relocation
that could not be resolved at assembly time was generated in the output
format. This is usually normal, but may not be handled by all possible
target environments
Disabled by default.
reloc-abs-word
: 16-bit absolute section-crossing
relocation
reloc-abs-word
warns that a 16-bit absolute relocation that
could not be resolved at assembly time was generated in the output format.
This is usually normal, but may not be handled by all possible target
environments
Disabled by default.
reloc-rel
: all reloc-rel-
warnings
reloc-rel
is a group alias for all warning classes prefixed
by reloc-rel-
; currently reloc-rel-byte
,
reloc-rel-dword
, reloc-rel-qword
,
reloc-rel-word
.
reloc-rel-byte
: 8-bit relative section-crossing relocation
reloc-rel-byte
warns that an 8-bit relative relocation that
could not be resolved at assembly time was generated in the output format.
This is usually normal, but may not be handled by all possible target
environments
Disabled by default.
reloc-rel-dword
: 32-bit relative section-crossing
relocation
reloc-rel-dword
warns that a 32-bit relative relocation
that could not be resolved at assembly time was generated in the output
format. This is usually normal, but may not be handled by all possible
target environments
Disabled by default.
reloc-rel-qword
: 64-bit relative section-crossing
relocation
reloc-rel-qword
warns that an 64-bit relative relocation
that could not be resolved at assembly time was generated in the output
format. This is usually normal, but may not be handled by all possible
target environments
Disabled by default.
reloc-rel-word
: 16-bit relative section-crossing
relocation
reloc-rel-word
warns that a 16-bit relative relocation that
could not be resolved at assembly time was generated in the output format.
This is usually normal, but may not be handled by all possible target
environments
Disabled by default.
unknown-pragma
: unknown %pragma
facility or
directive
unknown-pragma
is a backwards compatibility alias for
pragma-unknown
.
unknown-warning
: unknown warning in
-W
/-w
or warning directive
unknown-warning
warns about a -w
or
-W
option or a [WARNING]
directive that contains
an unknown warning name or is otherwise not possible to process.
Disabled by default.
user
: %warning
directives
user
controls output of %warning
directives
(see section 4.11).
Enabled by default.
warn-stack-empty
: warning stack empty
warn-stack-empty
a [WARNING POP]
directive was
executed when the warning stack is empty. This is treated as a
[WARNING *all]
directive.
Enabled by default.
zeroing
: RES
x in initialized section
becomes zero
zeroing
a RES
x directive was used in
a section which contains initialized data, and the output format does not
support this. Instead, this will be replaced with explicit zero content,
which may produce a large output file.
Enabled by default.
zext-reloc
: relocation zero-extended to match output
format
zext-reloc
warns that a relocation has been zero-extended
due to limitations in the output format.
Enabled by default.