News for hackers. Stuff that matters.
Re:Why Systems Programmers Still Use C (2006) by cygx on Monday March 19, 2012 @03:51AM (#3722890)
The fact that many compilers will warn with '-Wall' about code which is clearly incorrect, but due to the rules of C they cannot simply reject, is irritating.

The rules of C are actually stricter than many reople realize (add -std=c99 -pedantic-errors to gcc and you can get an idea about that -- this, however, still won't catch semantic errors like aliasing violations).

Personally, I'm using clang with -Weverything and remove warnings as necessary. On gcc, there are a lot of useful warnings which are not included in -Wall. My current warning levels look like this:

  -std=c99 -pedantic -Werror -Wall -Wextra \
  -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith \
  -Wcast-align -Wwrite-strings -Wredundant-decls -Wcast-qual \
  -Wnested-externs -Winline -Wno-long-long -Wconversion -Wstrict-prototypes

There are no comments on this comment yet.