On Fri, Sep 28, 2012 at 05:39:24PM +0300, Andrew W. Nosenko wrote:
> On Fri, Sep 28, 2012 at 4:22 PM, Adrian Bunk <[email protected]> wrote:
> > On Fri, Sep 28, 2012 at 04:10:29PM +0300, Andrew W. Nosenko wrote:
> >> On Fri, Sep 28, 2012 at 3:34 PM, Adrian Bunk <[email protected]> wrote:
> >> > On Thu, Sep 27, 2012 at 06:12:55PM -0700, Paul Eggert wrote:
> >> >> On 09/27/2012 10:04 AM, Adrian Bunk wrote:
> >> >> > 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.
> >> >>
> >> >> Yes. And programs using Autoconf will surely prefer the gnu11
> >> >> version, which is why defaulting to gnu11 is a win.
> >> >>...
> >> >
> >> > Which brings us back to why I call it a bug that gnu99 passes the
> >> > current C11 test.
> >>
> >> Exuse me, but if compiler+language support library passes all feature
> >> checks, which are essencial to name this pair c11-compatible, then why
> >> bother?
> >>
> >> If c11-compatibility implies more than these checks, then why not
> >> extend the checks for cover these essencial features?
> >>
> >> But please, dont start the messing with brain-dameged defines like
> >> __STDC_VERSION__. After all, Autoconf is all about the actual
> >> features of compilation environment, not about "branding labels" on
> >> that environment.
> >
> > C11 compatibility implies the correct __STDC_VERSION__ value.
>
> Are you never seen compilers that lie in defines? ICC and Clang both
> define __GNUC__ just for pass thru Linux and/or Glibc headers, for
> example?
What is your point here?
Noone suggests to check only for __STDC_VERSION__.
> > And as I already explained here in this thread the __STDC_VERSION__
> > value set by the compiler does matter, e.g. with glibc it enables some
> > C11 functionality in the C library.
>
> Then check this functionality, not define itself!
> If you think, for example, that quick_exit() is essencial, -- OK,
> check for quick_exit().
> _Static_assert? -- OK, check for _Static_assert.
The __STDC_VERSION__ is to some extent essential, and various files
under /usr/include/ from e.g. glibc, glib, X11 or zlib do use its value.
> Why check for guard defines and then imply that corresponding
> functionality exists if you can to check this functionality directly?
> Please, be practical! Autoconf is for build the real projects in the
> real environment, not the pedantic standard-complaince test for
> purposes of formal ISO certification.
Going back to the bug I reported and that we are discussing here:
The gnu99 and gnu11 modes of gcc seem to differ only in the
__STDC_VERSION__ value, and when autoconf does not try to set a gcc in
gnu99 mode into gnu11 mode that has consequences for real projects in
the real environment.
cu
Adrian
--
"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