This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC][PATCH v3] Initial support for C11 Annex K Bounds checking functions
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Ulrich Bayer <ubayer at sba-research dot org>
- Cc: libc-alpha at sourceware dot org, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Sun, 09 Jun 2013 01:06:44 -0700
- Subject: Re: [RFC][PATCH v3] Initial support for C11 Annex K Bounds checking functions
- References: <51B1B444 dot 8080608 at sba-research dot org>
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