Fix non-__GNUC__ definitions of __inline and __restrict (bug 17721)

Joseph Myers joseph@codesourcery.com
Wed Feb 7 00:49:00 GMT 2018


On Tue, 6 Feb 2018, Adhemerval Zanella wrote:

> >  /* __restrict is known in EGCS 1.2 and above. */
> >  #if !__GNUC_PREREQ (2,92)
> > -# define __restrict	/* Ignore */
> > +# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
> > +#  define __restrict	restrict
> > +# else
> > +#  define __restrict	/* Ignore */
> > +# endif
> >  #endif
> 
> Can't we dump the __GNUC_PREREQ and just check for __STDC_VERSION__? Or old
> GCC version does not correct correctly?

The point of the __GNUC_PREREQ (2,92) check is that for GCC 2.92 and later 
we still want to use __restrict (not define it to empty) outside C99 mode 
- whereas for other compilers, __restrict may not be supported, so we have 
to define it either to restrict or to empty.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list