A few others I use are -Wsign-compare and -Wformat-nonliteral. Sign compare warns on possible bugs/vulnerabilities due to comparing signed and unsigned values. Using nonliteral formats can lead to vulnerabilities (such as the famous attacks on FTP servers http://seclists.org/bugtraq/1999/Sep/328 )
-Wall includes -Wsign-compare
The most useful GCC options and extensions
11–20 of 22 posts
Re: The most useful GCC options and extensions
#12"All warnings can be enabled with -w."
man g++ says:
"-w Inhibit all warning messages."
Inhibit means to prevent (not to enable).
Re: The most useful GCC options and extensions
#13Re: The most useful GCC options and extensions
#14My favorite is the "weak" attribute. http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html Makes separate compilation for languages that compile to C much easier.
But unfortunately, since it was basically written only for libc purposes, it doesn't work on function pointers, so it's useless for this purpose.
Re: The most useful GCC options and extensions
#15No love for --coverage?
Re: The most useful GCC options and extensions
#16Re: The most useful GCC options and extensions
#17"If Java had true garbage collection, most programs would delete themselves upon execution." — Robert Sewell Nice ;-)
Re: The most useful GCC options and extensions
#18Is it me, or is this statement from the article wrong: "All warnings can be enabled with -w." man g++ says: "-w Inhibit all warning messages." Inhibit means to prevent (not to enable).