This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: Patch: Add __restrict to string.h


On Mon, 22 Jul 2013, Craig Howland wrote:

> We should be using "restrict" everywhere, not only in the docs.  The C
> standard defines restrict as a keyword, just as it does const, volatile, etc.
> And it has been standard for more than 13 years.  We do not use __const in
> headers, even though before C89 it was not standard but available as a GCC
> extension.  So while 15 years ago using __restrict would have made sense, it
> is not appropriate now.

You do realise that GCC does not enable the C99 "restrict" keyword by 
default, only in C99 mode (-std=c99/-std-gnu99/-std=c11/-std=gnu11), to 
avoid breaking C90 programs that use it as an identifier?  Using plain 
"restrict" in headers would prevent using those headers in GCC's default 
mode; even if defined to __restrict, it would prevent implementing a 
proper C90 mode in the headers.

-- 
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]