autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_CHECK_FUNCS and gcc with -Werror


From: Ralf Corsepius
Subject: Re: AC_CHECK_FUNCS and gcc with -Werror
Date: Wed, 03 Mar 2010 15:00:04 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Thunderbird/3.0.3

On 03/03/2010 02:44 PM, Eric Blake wrote:
According to Steffen Dettmer on 3/3/2010 6:33 AM:
what to do best here?
Not using -Werror

That's been the standard advice for years now.

Do I understand correctly that it is generally adviced to not use
the option -Werror?

Not quite.  The advice is to not mix -Werror and configure.
Post-configure, you can use -Werror to your heart's content, and I do it
all the time in packages that I maintain.  And it is even possible to let
configure check whether -Werror works, and if so, automatically add it to
CFLAGS.  It's just that configure checks themselves are not guaranteed to
be warning-free, so converting warnings to errors during configure is a
recipe for disaster.  In other words, the advice is that you shouldn't use
'./configure CFLAGS=-Werror'.

Another aspect is -Wall and -Werror are moving (and architecture dependent) targets. I.e. the number of warnings GCC will issue changes over time, triggering different kind of warnings.

I.e. when using -Werror a configure script will fail for different kinds of reasons at different places depending on your toolchain.

I.e. the best your "Development Rules" will be able to achieve is "warning free" compilation in a very narrowly pre-defined setup, with a well defined toolchain.

Don't do something if it hurts.

mmm... (I think the idea is to make a warning hurting to ensure
that it is fixed instantly and cannot be overseen / forgotten).

The problem is that no one has submitted a patch to make configure and
-Werror try to play nicely, until last month; and even then, it is not the
easiest thing in the world to do.
There is another aspect: There exist configure-checks which rely on switching on/off -Werror. I haven't checked how this recent submission co-exists with such kind of configure-checks.

Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]