warnings module allows to regularly build a package with more
GCC warnings than the default warnings emitted by GCC.
It provides the following functionality:
CFLAGSvariable at configuration time.
CFLAGSdoes not work in general, because it may break autoconfiguration.)
To use this module, you need the following:
gl_WARN_ADD([-Wall], [WARN_CFLAGS]) gl_WARN_ADD([-Wpointer-arith], [WARN_CFLAGS])
WARN_CFLAGS, use it in the definition of
AM_CFLAGS, like this:
AM_CFLAGS = $(WARN_CFLAGS)
Note that the
AM_CFLAGS is used in combination with
CFLAGS in build rules emitted by Automake. This allows
the user to provide
CFLAGS that override the
Note that it is a bad idea to use ‘gl_WARN_ADD([-Werror])’. The warnings emitted by GCC depend, to some extent, on the contents of the system header files, on the size and signedness of built-in types, etc. Use of ‘-Werror’ would cause frustration to all users on platforms that the maintainer has not tested before the release. It is better if maintainers use ‘-Werror’ only for themselves (for example, during ‘make distcheck’, as mentioned above).