autoconf
[Top][All Lists]
Advanced

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

RFE: macro for warning at configure-time if CFLAGS includes -Werror


From: Eric Blake
Subject: RFE: macro for warning at configure-time if CFLAGS includes -Werror
Date: Wed, 19 Sep 2012 15:01:24 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0

I just helped someone debug an issue today where their configure run was
getting weird results, because they had called './configure
CFLAGS="-Wall -Werror -O0 -g"', and the -Werror was causing several
tests to guess wrong.

This issue has repeatedly come up on this list, and our advice has
always been "don't use -Werror during configure; save it for 'make'".
In fact, we even have examples to point to on how to write a configure
script that will probe whether -Werror works and add it automatically at
make time without also polluting the rest of the configure run (such as
via coreutils' ./configure --enable-gcc-warnings, coupled with
Makefile.am snippets to add -Werror to AM_CFLAGS as appropriate).

For packages that already take care to separate out -Werror handling,
I'm thinking it might be worthwhile to have a macro that would emit a
warning at ./configure time if CC is detected as gcc, and CFLAGS
contains -Werror, since this usually won't have the desired results.  Of
course, it would need to be a new macro (we don't want to change the
behavior of configure to add a warning without explicit request by
package maintainers), but it seems like something that enough packages
would like to be worth including in the next autoconf release.  It seems
like such a macro should be called after AC_PROG_CC (need to know if the
compiler is gcc).

Thoughts?  Does my idea make sense?  What would a good macro name be?
AC_PROG_CC_SUSPICIOUS_CFLAGS
AC_PROG_CC_NO_WERROR

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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