This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Last <sys/cdefs.h> change
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: newlib at sourceware dot org
- Date: Thu, 23 May 2013 11:40:04 +0200
- Subject: Re: Last <sys/cdefs.h> change
- References: <519DC581 dot 20602 at embedded-brains dot de> <20130523074440 dot GA11512 at calimero dot vinschen dot de> <519DCD35 dot 3010709 at embedded-brains dot de> <20130523085859 dot GD13513 at calimero dot vinschen dot de> <519DDFFD dot 5030708 at embedded-brains dot de>
- Reply-to: newlib at sourceware dot org
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 <
201112L?
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat