This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix non-__GNUC__ definitions of __inline and __restrict (bug 17721)
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