Contents|Index|Previous|Next
Options to request or suppress warnings  

Warnings are diagnostic messages that report constructions which are not inherently erroneous; they may warn of risky constructions or constructions, actually, in error.

You can request many specific warnings with options beginning with ‘-W’; for instance, use ‘-Wimplicit’ to request warnings on implicit declarations. Each of these specific warning options also has a negative form beginning ‘-Wno-’ to turn off warnings; for instance, ‘-Wno-implicit’. This documentation discusses only one of the two forms, whichever is not the default.

The following options control the amount and kinds of warnings produced by GNU CC.
 

The remaining -W... options are not implied by -Wall. Some of them warn about constructions that users generally do not consider questionable, but which, on occasion, need to be checked for; others warn about constructions that are necessary or difficult to avoid in some cases, and for which there is no simple way to modify the code to suppress the warning.
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wredundant-decls -Wnested-externs -Winline
-Wold-style-cast
Warn if an old-style (C-style) cast is used within a program.
-Woverloaded-virtual -Wsynth (C++ only)
-Wlong-long
Warn if long long type is used. This is default. To inhibit the warning messages, use -Wno-long-long. Flags -Wlong-long and -Wno-long-long are taken into account only when the -pedantic flag is used.
-Werror

Top|Contents|Index|Previous|Next