Where can I find a list of all available warning and error flags I can set in clang and gcc? I've looked all over both of their respective documentation sites, and I can't find anything.
You can request many specific warnings with options beginning with ' -W ', for example -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 example, -Wno-implicit .
Compiler flags are options you give to gcc when it compiles a file or set of files. You may provide these directly on the command line, or your development tools may generate them when they invoke gcc.
gcc -Wall enables all compiler's warning messages. This option should always be used, in order to generate better code.
GCC 4.3+ now has -Q --help=warnings , and you can even specify --help=warnings,C to just print out the C related warnings.
gcc --help=warnings,seperate
gcc --help=warnings,joined
gcc --help=warnings,undocumented
gcc --help=warnings
seperate flags are like boolean values; they are either on or off.
-Wflag means on. -Wno-flag means off.
joined flags are flags that require a value.
-Wflag=value
by typing gcc --help=warnings you will recieve all the warning options provided by your compiler.
EDIT:
looking at GNU Documentation, these warnings messages have existed since GCC 4.3.6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With