[Top][All Lists]

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

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

From: Adrian Bunk
Subject: Re: bug: "gcc -std=gnu99" passes AC_PROG_CC_C11
Date: Thu, 27 Sep 2012 20:04:42 +0300
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Sep 27, 2012 at 09:24:39AM -0700, Paul Eggert wrote:
> 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()
> > - 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.

Whether testing for them in AC_PROG_CC is a good idea or not is more for
the discussion below (and e.g. the glibc in next year's Debian release 
is so old that it doesn't contain most of these even though the gcc
shipped supports gnu11).

I merely wanted to point out that there can be a difference in what 
glibc provides when we end up with gnu99 instead of gnu11.

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

AC_PROG_CC_C99 in autoconf 2.69 has a documented semantics what C99
features are guaranteed to be available when ac_cv_prog_cc_c99 is
not "no".

Perhaps mode setting and feature reporting to autoconf users should be 
less coupled for C11?

In any case, autoconf has to provide an easy and documented way for 
users to get information on the C11 features available.



       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

reply via email to

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