This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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] |
Joseph S. Myers wrote:
I certainly don't think they should be overriding _Static_assert provided by GCC (>= 4.6)
Good point, thanks. Revised patches attached.
I don't think the installed glibc headers should be providing _Static_assert
It's what FreeBSD <sys/cdefs.h> does, and applications seem to be doing fine there. So there's good precedent, it's not risky, and it would improve compatibility with FreeBSD.
arguably assert.h should try to do something for the case of _ISOC11_SOURCE, non-C11 compiler
That wouldn't support one of the main attractions of _Static_assert, namely that it works even when <assert.h> isn't included. Application writers will prefer this feature, and defining _Static_assert in cdefs.h gets us close enough to this goal to be reasonably useful in apps compiled with pre-C11 compilers.
generally that applies to any compiler possibly providing _Static_assert outside C11 mode - the library shouldn't get in the way of the user using the compiler feature
In general that's a good principle, but here there's not much to get in the way of, as the glibc substitute does the job even when it takes over from Clang etc. If there's consensus I could add the usual forest of #ifs so as to not #define _Static_assert in non-GCC pre-C11 compilers where _Static_assert is known to work, but that's not what we've done in similar situations elsewhere in glibc, and there is some virtue in simplicity.
Attachment:
0001-Approximate-_Static_assert-for-pre-C11-compilers.patch
Description: Text document
Attachment:
0002-fts-allow-_FILE_OFFSET_BITS-64-on-64-bit-hosts.patch
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |