bug-autoconf
[Top][All Lists]
Advanced

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

Re: bug: "gcc -std=gnu99" passes AC_PROG_CC_C11


From: Paul Eggert
Subject: Re: bug: "gcc -std=gnu99" passes AC_PROG_CC_C11
Date: Thu, 27 Sep 2012 09:24:39 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

On 09/27/2012 07:29 AM, Adrian Bunk wrote:
> glibc 2.16 has the following protected by what boils down to
>   #if defined _GNU_SOURCE || defined _ISOC11_SOURCE || \
>       (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)
> 
> - timespec_get() and TIME_UTC
> - aligned_alloc()
> - at_quick_exit()
> - quick_exit()
> - CMPLX/CMPLXF/CMPLXL
> - static_assert

Thanks for mentioning that.  I'd missed those.  Normally
this is considered part of the C library, not of the C compiler,
so AC_PROG_CC shouldn't check for it.  But it is an argument for
people using either AC_PROG_CC or AC_USE_SYSTEM_EXTENSIONS,
so that they can get the above symbols.  (This is true for
older versions of Autoconf too, for AC_USE_SYSTEM_EXTENSIONS.)

> It's a policy decision which features should be guaranteed to be 
> available when ac_cv_prog_cc_c11 is not "no"

Yes, that's the dicey thing.  AC_PROG_CC doesn't really guarantee
C11 (or C99 or C89); it merely tries to do its best to make the
compiler more up-to-date.  In effect, Autoconf is warring against
the understandable conservativism of compiler implementers.
Autoconf-generated programs want the latest and greatest version,
whereas compiler-writers are often concerned that the latest version
will break ancient programs.  Hence compiler-writers are often too-
conservative about setting defaults, from Autoconf's point of view,
and Autoconf is striving to overcome that.  The features Autoconf
are testing for are a means to an end (getting more-up-to-date
compiler), not the end itself (a list of supported features; there
is no such list, really).



reply via email to

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