-warnings

Specifies which warning messages the command-line tool issues. This command is global.

Syntax
  -w[arnings] 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. Refer Table 1for a list of warning messages turned on by the -w[arnings] on command.

Equivalent to #pragma warning on

most

Turns on most warnings.

all

Turns on almost all warnings and require prototypes.

full

Turns on all warning messages and require prototypes. This option is likely to generate spurious warnings.

Note: -warnings full should be used before using any other options that affect warnings. For example, use -warnings full -warnings noanyptrintconv instead of -warnings noanyptrintconv -warnings full.

[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

[no]pragmas | [no]illpragmas

Issues warning messages on invalid pragmas. Enabled when most is used. Equivalent to

  #pragma warn_illpragma

  

[no]empty[decl]

Issues warning messages on empty declarations. Enabled when most is used. Equivalent to

  #pragma warn_emptydecl

  

[no]possible | [no]unwanted

Issues warning messages on possible unwanted effects. Enabled when most is used. Equivalent to

  #pragma warn_possunwanted

  

[no]unusedarg

Issues warning messages on unused arguments. Enabled when most is used. Equivalent to

  #pragma warn_unusedarg

  

[no]unusedvar

Issues warning messages on unused variables. Enabled when most is used. Equivalent to

  #pragma warn_unusedvar

  

[no]unused

Same as

  -w [no]unusedarg,[no]unusedvar 
  

Enabled when most is used.

[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. Enabled when most is used. Equivalent to

  #pragma warn_extracomma

  

[no]extended

Extended error checking. Enabled when most is used. Equivalent to either:

  #pragma extended_errorcheck

  

[no]hidevirtual | [no]hidden[virtual]

Issues warning messages on hidden virtual functions. Enabled when most is used. Equivalent to

  #pragma warn_hidevirtual

  

[no]implicit[conv]

Issues warning messages on implicit arithmetic conversions. Enabled when all is used. Implies

  -warn impl_float2int,impl_signedunsigned 
  

[no]impl_int2float

Issues warning messages on implicit integral to floating conversions. Enabled when all is used. Equivalent to

  #pragma warn_impl_i2f_conv

  

[no]impl_float2int

Issues warning messages on implicit floating to integral conversions. Enabled when all is used. Equivalent to

  #pragma warn_impl_f2i_conv

  

[no]impl_signedunsigned

Issues warning messages on implicit signed/unsigned conversions. Enabled when all is used.

[no]notinlined

Issues warning messages for functions declared with the inline qualifier that are not inlined. Enabled when full is used. Equivalent to

  #pragma warn_notinlined

  

[no]largeargs

Issues warning messages when passing large arguments to unprototyped functions. Enabled when most is used. Equivalent to

  #pragma warn_largeargs

  

[no]structclass

Issues warning messages on inconsistent use of class and struct. Enabled when most is used. Equivalent to

  #pragma warn_structclass

  

[no]padding

Issue warning messages when padding is added between struct members. Enabled when full is used. Equivalent to

  #pragma warn_padding

  

[no]notused

Issues warning messages when the result of non-void-returning functions are not used. Enabled when full is used. Equivalent to

  #pragma warn_resultnotused

  

[no]missingreturn

Issues warning messages when a return without a value in non-void-returning function occurs. Enabled when most is used. 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. Enabled when full is used.

[no]anyptrintconv

Issues warning messages on any conversion of pointers to integers. Enabled when full is used. Equivalent to

  #pragma warn_ptr_int_conv

  

[no]undef[macro]

Issues warning messages on the use of undefined macros in #if and #elif conditionals. Enabled when full is used. Equivalent to

  #pragma warn_undefmacro

  

[no]filecaps

Issues warning messages when # include "" directives use incorrect capitalization. Enabled when most is used. Equivalent to

  #pragma warn_filenamecaps 
  

[no]sysfilecaps

Issue warning messages when # include <> statements use incorrect capitalization. Enabled when most is used. Equivalent to

  #pragma warn_filenamecaps_system

  

[no]tokenpasting

Issue warning messages when token is not formed by the ## preprocessor operator. Enabled when most is used. Equivalent to

  #pragma warn_illtokenpasting

  

[no]relax_i2i_conv

Relax implicit arithmetic conversion warnings on certain implicit conversions. Equivalent to

  #pragma relax_i2i_conv

  

noSymRedef

Suppress symbol redefined warnings. Passed to linker (By default linker emits Symbol Redefined warnings).

display | dump

Display list of active warnings.

Remarks

The table below lists the equivalent command option of the warning messages turned on by the -w[arnings] on command.

Related information
-disassemble
-warningerror
-help
-maxerrors
-maxwarnings
-msgstyle
-ide_err
-nofail
-progress
-S
-stderr
-verbose
-version
-timing
-wraplines