Suppressing Warning Messages or Enabling Remarks

Use the -w or -Wn option to suppress warning messages or to enable remarks during the preprocessing and compilation phases. You can enter the option with one of the following arguments:

Option Description
-w0,-w Displays error messages only. Both -w0 and -w display exactly the same messages.
-w1,-w2 Displays warnings and error messages. Both -w1 and -w2 display exactly the same messages.The compiler uses this level as the default.
-w3 Displays warnings and error messages. This option displays more warnings than do -w1 and -w2.
-w4 Displays remarks, warnings, and error messages.

For some compilations, you might not want warnings for known and benign characteristics, such as the K&R C constructs in your code. For example, the following command compiles newprog.cpp and displays compiler errors, but not warnings: