__restrict__ vs __restrict ?

Tim Kientzle kientzle at acm.org
Fri Jan 16 20:03:08 PST 2004


Ruslan Ermilov wrote:
> On Fri, Jan 16, 2004 at 05:23:01PM -0800, Tim Kientzle wrote:
> 
>>Question:  Does anyone know the difference between
>>__restrict and __restrict__?
> 
> __restrict__ is the gcc(1)-only feature.
> __restrict is defined in <sys/cdefs.h>, it's the FreeBSD feature.

A-ha!  That's the part I had missed.  After a few experiments
with gcc -dM -E, I've convinced myself that this is just another
GCC bug.  Basically, -std=c99 -ansi seems to be a very bad compination,
as -std=c99 defines __STDC_VERSION__ to be 199901L and -ansi then
turns off compiler support for c99 features.  Ugh.

>>Should we be using the latter in our system headers?
> 
> No, we should be using the __restrict as coded.  But I wonder why
> we can't just use "restrict"...

Because that would really mess up any user program that used
'restrict' as a variable or function name.  I think the
current approach is the best.

Thanks for the clarification.  I'll go crawl back under
my nice, comfortable rock now.

Tim



More information about the freebsd-hackers mailing list