Hacker News new | ask | show | jobs
by fafner 4478 days ago
-pedantic-errors is also a very useful flag.

-Wstrict-aliasing=1/-Wsuggest-attribute= can give good suggestions during development.

Probably not useful for Ag: But I do a lot of numeric stuff so -Wfloat-equal is handy for me. For code using float this should be mandatory: -Wdouble-promotion.

1 comments

gcc's -Wstrict-aliasing is extremely inaccurate. It doesn't run inside the aliasing machinery; it's just a cheap heuristic inside the C parser. I'd call it a good example of why you shouldn't strive to fix a warning just because it happens to exist.

I thought there was a better tool, but can't find the name, hmm.