This is the mail archive of the cygwin-developers mailing list for the Cygwin 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: Fix invalid use of restrict


On Nov 28 11:34, Corinna Vinschen wrote:
> 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 glob.cc 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
>   #else
>   #define __restrict      restrict
>   #endif
>   #endif
> 
> __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.

Uh, never mind.  In glibc headers it's not defined for C++ either.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpkBNRxmPYdt.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]