This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ 17979][BZ 17721] Fix issues with sys/cdefs.h and uchar.h when using non-gcc compiler.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Dwight Guth <dwight dot guth at runtimeverification dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 28 Jan 2016 21:19:26 +0000
- Subject: Re: [PATCH][BZ 17979][BZ 17721] Fix issues with sys/cdefs.h and uchar.h when using non-gcc compiler.
- Authentication-results: sourceware.org; auth=none
- References: <27c31890079f41775175b94a4abedb0c dot squirrel at server316 dot webhostingpad dot com>
On Thu, 28 Jan 2016, Dwight Guth wrote:
> Glibc strips __restrict from the prototypes of C library functions in this
> case. This is incorrect if the compiler is a C99-compliant compiler, because
> C99 includes the restrict keyword and uses it in the declaration of a number
> of functions in the C library. This leads to undefined behavior because
> the definitions of those functions were defined with the restrict keyword,
> which makes their type signatures incompatible with their declaration,
> a violation of C99 sec. 6.2.7 paragraph 2. The same thing occurs with the
This affects hardly any functions, if any at all, because qualifiers on
function argument types are ignored for the purposes of compatibility
(6.7.5.3#15). For a function to be affected it would need a restrict
qualifier that isn't directly on the argument type itself (type *restrict
*param, for example).
--
Joseph S. Myers
joseph@codesourcery.com