static_assert in c89 and c99

Paul Eggert eggert@cs.ucla.edu
Thu Feb 5 23:57:00 GMT 2015


On 02/05/2015 01:42 PM, Rich Felker wrote:
> glibc should check for 100*__GNUC__+__GNUC_MINOR__<406
> and use an alternate definition for _Static_assert in that case
This sounds right, and is like the similar situation for _Noreturn 
where' there's already a substitute in misc/sys/cdefs.h for older 
compilers.  Proposed patch attached.  (Not while we're frozen, of course.)

This patch borrows the implementation from Gnulib.  We've run into 
compilers that allow arrays of negative size (!) but none that allow 
bitfields of negative size, which is why we use bitfields.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-ersatz-_Static_assert-on-older-hosts.patch
Type: text/x-patch
Size: 1824 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150205/3be1c64a/attachment.bin>


More information about the Libc-alpha mailing list