E
Ersek, Laszlo
WARN_BASE=-Wc,-Wall -Wc,-W
WARN_BASE += -Wc,-Wno-unknown-pragmas
WARN_BASE += -Wc,-Wpointer-arith
WARN_BASE += -Wc,-Wshadow
WARN_BASE += -Wc,-Wwrite-strings
WARN=$(WARN_BASE)
WARN += -Wc,-pedantic
WARN += -Wc,-Wbad-function-cast
WARN += -Wc,-Wcast-align
WARN += -Wc,-Wcast-qual
WARN += -Wc,-Wconversion
WARN += -Wc,-Wformat-nonliteral
WARN += -Wc,-Wmissing-declarations
WARN += -Wc,-Wmissing-prototypes
WARN += -Wc,-Wnested-externs
WARN += -Wc,-Wstrict-prototypes
WARN += -Wc,-Wundef
The "pedantic" reader will notice that the "-Wall" option to gcc
doesn't really get you "all" warnings, as you would rightfully expect.
When using the "-Wall" option with gcc, think of it as something like
"-Wmost" or "-Wmany". Go figure.
Interesting. I notice you don't pass -ansi or -std=c[89]9, even though
you pass -pedantic. Maybe you do this exactly in order to enable C++
style comments:
----v----
`-ansi'
[...] For the C compiler, it disables recognition of C++ style `//'
comments as well as the `inline' keyword.
----^----
I use -Wformat=2 instead of -Wformat-nonliteral, as the former includes
the latter and more. I also pass -Wfloat-equal -Wlarger-than-32767
-Wlong-long -Wredundant-decls -Wunreachable-code.
Cheers,
lacos