Another Japan in the World

Jun Aruga's blog, who lived in Japan, Singapore, live in Czech Republic. Mainly about IT and travel.

Better gcc argument option to output all the warnings

If you want to check all the warnings about your code on gcc, I guess we should use not "-Wall" but "-Werror".

See below gcc 5.3 manual.
Warning Options - Using the GNU Compiler Collection (GCC)

  • Werror

Make all warnings into errors.

  • Wall

This enables all the warnings about constructions that some users consider questionable, and that are easy to avoid (or modify to prevent the warning), even in conjunction with macros. This also enables some language-specific warnings described in C++ Dialect Options and Objective-C and Objective-C++ Dialect Options.
...
Note that some warning flags are not implied by -Wall. Some of them warn about constructions that users generally do not consider questionable, but which occasionally you might wish to check for; others warn about constructions that are necessary or hard to avoid in some cases, and there is no simple way to modify the code to suppress the warning. Some of them are enabled by -Wextra but many of them must be enabled individually.

I was inspired from below stackoverflow article.
c - Choosing a static code analysis tool - Stack Overflow

Remove all ads