Re:Found a bug in the GCC system (not deep, complex or new, ...
by pmiller2 on Saturday May 22, 2010 @05:27AM
(#1370071)
I always use "-W -Wall -ansi -pedantic". Substitute -std=c99 for -ansi if you swing that way. I then run my code through a couple of other static checkers just to see what comes up.
This frequently results in me finding some subtle bug which otherwise could have taken hours of head scratching or single-stepping in gdb to locate.
Re:Found a bug in the GCC system (not deep, complex or new, ...
by hga on Saturday May 22, 2010 @10:46AM
(#1370379)
Yeah, I've been using "-Wall -Werror -Wstrict-prototypes -pedantic" as of late and I clearly need to start thinking about a -std or -ansi.
C is a somewhat weak foundation for static program analysis but that doesn't mean we can't try to make the most out of it.
Re:Found a bug in the GCC system (not deep, complex or new, ...
by astrange on Saturday May 22, 2010 @10:31PM
(#1371600)
"-Werror=implicit" would be more useful here. -Wall won't prevent that from compiling, but there's hardly any situation where you'd want it to compile.
Re:Found a bug in the GCC system (not deep, complex or new, ...
by ciupicri on Friday May 21, 2010 @11:54AM
(#1367713)
Btw, is there a GCC specific way to disable warnings for some portions of code?
Re:Found a bug in the GCC system (not deep, complex or new, ...
by shabble on Friday May 21, 2010 @12:17PM
(#1367790)
http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html should get you most of the way there.
"The moral? Always use -Wall"