[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to build source code while treating all warnings as errors with
From: |
Erik de Castro Lopo |
Subject: |
Re: How to build source code while treating all warnings as errors with automake... |
Date: |
Tue, 19 Feb 2008 09:53:04 +1100 |
NotFound wrote:
> By the way, including -Werror in CFLAGS at configure time breaks
> several automake and autoconf tests. This is a shame, but I suppose it
> will be almost impossible to make all tests warning-free.
Like some of the other respondants have said, you need to be careful
that you don't break compiles on platforms you haven't tested.
However, I'm a contributor to a project called liboggz which can be
pulled from SVN here:
http://svn.annodex.net/liboggz/trunk
A lot of what you want in its configure.ac and Makefile.am files
for that project. For instance:
- Configure.ac detects the compiler and if it is GCC, enables
a whole bunch of -W flags.
- Configure.ac has a --enable-gcc-werror configure flag so that
if the compiler is gcc, it also adds -Werror.
- The top level Makefile.am sets DISTCHECK_CONFIGURE_FLAGS to
--enable-gcc-werror so that the make distcheck will run with
-Werrror turned on if the compiler is GCC.
Have a look at liboggz and feel free to grab some of these
techniques from configure.ac and Makefile.am.
Cheers,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"[Perl] combines all the worst aspects of C and Lisp: a billion different
sublanguages in one monolithic executable. It combines the power of C with
the readability of PostScript." -- Jamie Zawinski