Specifies which warning messages the command-line tool issues. This command is global.
-w[arning] keyword [,...]
The options for keyword are:
off
Turns off all warning messages. Passed to all tools. Equivalent to
#pragma warning off
on
Turns on most warning messages. Passed to all tools. Equivalent to
#pragma warning on
[no]cmdline
Passed to all tools.
[no]err[or] | [no]iserr[or]
Treats warnings as errors. Passed to all tools. Equivalent to
#pragma warning_errors
all
Turns on almost all warning messages and require prototypes.
[no]pragmas | [no]illpragmas
Issues warning messages on invalid pragmas. Equivalent to
#pragma warn_illpragma
[no]empty[decl]
Issues warning messages on empty declarations. Equivalent to
#pragma warn_emptydecl
[no]possible | [no]unwanted
Issues warning messages on possible unwanted effects. Equivalent to
#pragma warn_possunwanted
[no]unusedarg
Issues warning messages on unused arguments. Equivalent to
#pragma warn_unusedarg
[no]unusedvar
Issues warning messages on unused variables. Equivalent to
#pragma warn_unusedvar
[no]unused
Same as
-w [no]unusedarg,[no]unusedvar
[no]extracomma | [no]comma
Issues warning messages on extra commas in enumerations. The compiler ignores terminating commas in enumerations when compiling source code that conforms to the ISO/IEC 9899-1999 ("C99") standard. Equivalent to
#pragma warn_extracomma
[no]pedantic | [no]extended
Pedantic error checking.
[no]hidevirtual | [no]hidden[virtual]
Issues warning messages on hidden virtual functions. Equivalent to
#pragma warn_hidevirtual
[no]implicit[conv]
Issues warning messages on implicit arithmetic conversions. Implies
-warn impl_float2int,impl_signedunsigned
[no]impl_int2float
Issues warning messages on implicit integral to floating conversions. Equivalent to
#pragma warn_impl_i2f_conv.This flag requires -w implicit, e.g. -w implicit,impl_int2float
[no]impl_float2int
Issues warning messages on implicit floating to integral conversions. Equivalent to
#pragma warn_impl_f2i_conv. This flag requires -w implicit, e.g. -w implicit,impl_float2int
[no]impl_signedunsigned
Issues warning messages on implicit signed/unsigned conversions. This flag requires -w implicit, e.g. -w implicit, impl_signedunsigned
[no]relax_i2i_conv
Relax warnings for implicit integer to integer arithmetic conversion.Default is -relax_i2i_conv. -w full sets the option to -norelax_i2i_conv.
[no]notinlined
Issues warning messages for functions declared with the inline qualifier that are not inlined. Equivalent to
#pragma warn_notinlined
[no]largeargs
Issues warning messages when passing large arguments to unprototyped functions. Equivalent to
#pragma warn_largeargs
[no]structclass
Issues warning messages on inconsistent use of class and struct. Equivalent to
#pragma warn_structclass
[no]padding
Issue warning messages when padding is added between struct members. Equivalent to
#pragma warn_padding
[no]notused
Issues warning messages when the result of non-void-returning functions are not used. Equivalent to
#pragma warn_resultnotused
[no]missingreturn
Issues warning messages when a return without a value in non-void-returning function occurs. Equivalent to
#pragma warn_missingreturn
[no]unusedexpr
Issues warning messages when encountering the use of expressions as statements without side effects. Equivalent to
#pragma warn_no_side_effect
[no]ptrintconv
Issues warning messages when lossy conversions occur from pointers to integers.
[no]anyptrintconv
Issues warning messages on any conversion of pointers to integers. Equivalent to
#pragma warn_ptr_int_conv
[no]undef[macro]
Issues warning messages on the use of undefined macros in #if and #elif conditionals. Equivalent to
#pragma warn_undefmacro
[no]filecaps
Issues warning messages when # include "" directives use incorrect capitalization. Equivalent to
#pragma warn_filenamecaps
[no]sysfilecaps
Issues warning messages when # include <> statements use incorrect capitalization. Equivalent to
#pragma warn_filenamecaps_system
[no]tokenpasting
Issues warning messages when token is not formed by the ## preprocessor operator. Equivalent to
#pragma warn_illtokenpasting
display | dump
Displays list of active warnings.