The -W
warning categories options have nothing to do with C[XX]FLAGS
. These are command line arguments used when invoking automake.
Conversely, the AM_INIT_AUTOMAKE
options like -Wall
don't affect the compiler flags. It's just the decision to use these switch names that is resulting in the confusion. They have a similar meaning, e.g., -Werror
will treat automake warnings as errors, but are totally unrelated.
In short, you have to pass -Wall
, etc., in C[XX]FLAGS
to influence the compiler. And add -Wall
to AM_INIT_AUTOMAKE
to enable all warning categories when automake is invoked.