This is the mail archive of the mailing list for the newlib project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Last <sys/cdefs.h> change

On May 23 11:23, Sebastian Huber wrote:
> On 05/23/2013 10:58 AM, Corinna Vinschen wrote:
> >I don't quite grok the !defined(__STDC_VERSION__) here.  gcc 4.6 defines
> >_Static_assert independently from the -std setting and independently
> >from -ansi.  It's just there, always.  The coreutils header assumes that
> >_Static_assert exists because it found that it's compiled with gcc 4.6
> >or later.  It uses the _Static_assert in a way which works with the
> >builtin version of gcc.  This collides with the definition of
> >_Static_assert in cdefs.h.  Now, with your change, cdefs.h would fall
> >back to its own definition again if __STDC_VERSION__ is defined, thus
> >your change would break coreutils again.
> The only broken thing here is coreutils.  They set -std=gnu99 and
> use C11 features.  They use also _Static_assert() in a way that
> seems to be not available with pre C11 means.

Not quite.  They just have a reason to make tests along the lines of
what _Static_assert provides.  They check for the compiler version and
find that the compiler already provides _Static_assert.  That's where
our cdefs.h header collides.  So, here's the question:  Given that
collision in the __STDC_VERSION__ == 199901L case, why do *we* (or,
FWIW, FreeBSD) provide _Static_assert, even though __STDC_VERSION__ is <


Corinna Vinschen
Cygwin Maintainer
Red Hat

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]