[Top][All Lists]

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

Re: AC_CHECK_FUNCS and gcc with -Werror

From: Eric Blake
Subject: Re: AC_CHECK_FUNCS and gcc with -Werror
Date: Wed, 03 Mar 2010 06:44:13 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090812 Thunderbird/ Mnenhy/

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'.

>> 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.

> Yes, inside configure -Werror isn't needed but for compiling
> all the programs source files. How to add it for the program but
> not for the configure run? Via libxyz_a_CFLAGS of all libs?

That's one way.  Or even via CFLAGS itself.  It's just that you have to be
careful that the CFLAGS are different during the configure run than during
make in that case.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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