Fix invalid use of restrict

Corinna Vinschen
Thu Nov 28 10:34:00 GMT 2013

On Nov 28 14:06, Alexpux wrote:
> 28 нояб. 2013 г., в 14:04, Corinna Vinschen написал(а):
> > On Nov 28 12:03, Alexey Pavlov wrote:
> >> In CVS version I get error: invalid use of restrict. Patch for it is below
> > 
> > Thanks, applied.  Why on earth does none of my GCCs throw an error
> > or warning about this?!?
> Because I got this error not on building runtime but when build other program with this headers.

But includes glob.h as well.  It should have picked up the wrong
definition and ... oh, darn.  "restrict" is filtered out in C++ because
it's a C99 keyword.  Here's what sys/cdefs.h does:

  #if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95)
  #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 || defined(lint)
  #define __restrict
  #define __restrict      restrict

__STDC_VERSION__ is not defined when building C++ files.

However, G++ knows the __restrict and __restrict__ keyword, so I wonder
if we shouldn't enable __restrict when building C++ with g++.  I guess
I'll discuss this on the newlib list.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <>

More information about the Cygwin-developers mailing list