bug-autoconf
[Top][All Lists]
Advanced

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

Re: AC_CHECK_FUNC is not compatible with gcc -Werror


From: Dmitry V. Levin
Subject: Re: AC_CHECK_FUNC is not compatible with gcc -Werror
Date: Fri, 26 Feb 2010 04:08:19 +0300

On Sat, Jan 23, 2010 at 03:21:06PM +0300, Dmitry V. Levin wrote:
> On Sat, Jan 23, 2010 at 09:52:20AM +0100, Paolo Bonzini wrote:
> > On 01/23/2010 01:26 AM, Dmitry V. Levin wrote:
> > >I'm not sure about $ac_[]_AC_LANG_ABBREV[]_werror_flag, because it is not
> > >set when -Werror is included in CFLAGS, and the latter case is more common
> > >than the use of AC_LANG_WERROR.
> > 
> > ... but still you use AC_LANG_WERROR in the testcase.
> 
> Here is another test, for gcc -Werror:
> 
> # AC_CHECK_FUNCS with gcc -Werror
> # -------------------------------
> # Check that it performs the correct actions:
> # Must define HAVE_PRINTF, but not HAVE_AUTOCONF_FTNIRP
> AT_CHECK_MACRO([AC_CHECK_FUNCS with gcc -Werror],
> [AC_PROG_CC
> test "$GCC" = yes || exit 77
> CFLAGS="${CFLAGS-} -Werror"; export CFLAGS
> AC_CHECK_FUNCS(printf autoconf_ftnirp)],
> [AT_CHECK_DEFINES(
> [/* #undef HAVE_AUTOCONF_FTNIRP */
> #define HAVE_PRINTF 1
> ])])
> 
> > It's been broken forever,
> 
> Yes, but...
> 
> > I think we can afford supporting only the case when 
> > AC_LANG_WERROR is used explicitly.
> 
> I'm not sure about it.  The most common case is when CFLAGS is made before
> a ./configure call.  I'm aware of build systems where CFLAGS variable is
> being constructed based on other build parameters including Werror.
> Of course it's easy to replace
>       if test "$GCC" = yes; then
> with
>       if test "$GCC":"$ac_[]_AC_LANG_ABBREV[]_werror_flag" = yes:yes; then
> and continue telling people to avoid -Werror before ./configure, but it
> means that I'll have to maintain this one-line patch that removes the
> werror flag check.

Well, is there a consensus to make AC_CHECK_FUNC compatible with
AC_LANG_WERROR and/or "gcc -Werror"?


-- 
ldv

Attachment: pgpao7TOg2C9w.pgp
Description: PGP signature


reply via email to

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