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]

Re: [RFC][PATCH v2] Initial support for C11 Annex K Bounds checking functions


On Wed, 5 Jun 2013, Paul Eggert wrote:

> * It won't work with <stddef.h>, which is supplied
> by the compiler, not by glibc, and whose behavior should
> depend on __STDC_WANT_LIB_EXT1__.

The same inconsistency of course applies to other cases with the headers 
GCC installs - e.g. <float.h> can only test __STDC_VERSION__ to determine 
whether to define C99 and C11 macros, whereas glibc headers would also 
define them for _GNU_SOURCE.

> * It could generate bogus diagnostics.  If (say) <stdio.h>
> defines __STDC_WANT_LIB_EXT1__, then K.3.1.1 paragraph 4
> would require a diagnostic for this program:

That does indicate maybe using __STDC_WANT_LIB_EXT1__ || __USE_GNU in 
headers, instead of defining __STDC_WANT_LIB_EXT1__ in features.h.

> Which brings up another point: the proposed implementation doesn't
> support K.3.1.1 paragraph 4 -- shouldn't it?

As previously discussed, that requires a new GCC feature, maybe a pragma 
for affected headers to use, given that the check is needed for multiple 
includes of the same header (despite multiple include optimization) and 
that as I interpret it the requirement is for identical token sequences 
(including whether whitespace separates each pair of tokens - the same 
requirement as for duplicate #defines in 6.10.3).

-- 
Joseph S. Myers
joseph@codesourcery.com


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