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 v3] Initial support for C11 Annex K Bounds checking functions


On 06/07/2013 03:21 AM, Ulrich Bayer wrote:
> Instead of misusing features.h (with global effects) we could create a new header 
> called e.g. annex_k_protection.h which is included by all Annex K relevant headers. 
> This header can then check whether __STDC_WANT_LIB_EXT1__ has the same value
> for all inclusions of an Annex K header.  

Here's a draft implementation of that header.  Or, since this is short,
perhaps we can just copy this text into all Annex K relevant headers.

#ifdef __GLIBC_LIB_EXT1__
# if (__GLIBC_LIB_EXT1__ != \
      (defined __STDC_WANT_LIB_EXT1__ ? __STDC_WANT_LIB_EXT1__ : -1))
#  error "__STDC_WANT_LIB_EXT1__ defined inconsistently"
# endif
# undef __GLIBC_LIB_EXT1__
#endif
#ifndef __STDC_WANT_LIB_EXT1__
# define __GLIBC_LIB_EXT1__ (-1)
#elif __STDC_WANT_LIB_EXT1__ == 1
# define __GLIBC_LIB_EXT1__ 1
#else
# define __GLIBC_LIB_EXT1__ 0
#endif


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