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: Dwight Guth <dwight dot guth at runtimeverification dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Dwight Guth <dwight dot guth at runtimeverification dot com>, libc-alpha at sourceware dot org
- Date: Thu, 28 Jan 2016 16:50:12 -0600
- 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> <alpine dot DEB dot 2 dot 10 dot 1601282115100 dot 6102 at digraph dot polyomino dot org dot uk> <CACLXh_1_dQ5D1QrKQN0pVPzt001WmS4BgwcKZkULK8XnbEMb+g at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1601282246340 dot 6102 at digraph dot polyomino dot org dot uk>
Okay but if so, then why put the __restrict in the header files at all
if it doesn't really matter? And why put it there only if the compiler
is gcc?
On Thu, Jan 28, 2016 at 4:48 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Thu, 28 Jan 2016, Dwight Guth wrote:
>
>> Thank you for drawing that to my attention. You are correct that this
>> means that my original issue that caused me to create this part of the
>> patch is in fact well defined. However, this still seems like an issue
>> of correctness to me. I can't seem to find any explicit paragraph in
>> the standard saying that, e.g. fprintf must be declared with the type:
>>
>> int fprintf(FILE * restrict stream, const char * restrict format, ...);
>>
>> but I assume that that is implied, otherwise we could give any of the
>> functions in the library any signature as long as they broadly
>> followed the requirements of their corresponding subclause, which
>> seems wrong to me.
>
> It's impossible for a valid program to distinguish what qualifiers were
> used for parameters in a function declaration in a header, thus it's not
> even a meaningful question.
>
> --
> Joseph S. Myers
> joseph@codesourcery.com