3 ms·
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 jus
by pmiller2 16y ago
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.
- hga 16y agoYeah, 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.