Re: AC_CHECK_FUNCS and gcc with -Werror

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

 



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


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux