Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: