Next: , Previous: , Up: Build Infrastructure Modules   [Contents][Index]

19.5 warnings

The warnings module allows to regularly build a package with more GCC warnings than the default warnings emitted by GCC. It is often used indirectly through the manywarnings module (see manywarnings).

It provides the following functionality:

To use this module, you need the following:

  1. In, use for example
    gl_WARN_ADD([-Wall], [WARN_CFLAGS])
    gl_WARN_ADD([-Wpointer-arith], [WARN_CFLAGS])
  2. In the directories which shall use WARN_CFLAGS, use it in the definition of AM_CFLAGS, like this:

    Note that the AM_CFLAGS is used in combination with CFLAGS and before CFLAGS in build rules emitted by Automake. This allows the user to provide CFLAGS that override the WARN_CFLAGS.

gl_WARN_ADD([-Werror])’ is intended for developers, and should be avoided in contexts where it would affect ordinary installation builds. 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 ‘-Werror’ is off by default, and is enabled only by developers. For example, ‘-Werror’ could affect ‘make distcheck’ or ‘configure --enable-gcc-warnings’ as mentioned above.

Next: manywarnings, Previous: configmake, Up: Build Infrastructure Modules   [Contents][Index]