__restrict__ vs __restrict ?

Ruslan Ermilov ru at FreeBSD.org
Sat Jan 17 09:32:23 PST 2004


On Sat, Jan 17, 2004 at 09:19:28AM -0800, David O'Brien wrote:
> On Fri, Jan 16, 2004 at 08:03:05PM -0800, Tim Kientzle wrote:
> > >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.
> 
> Such code isn't portable to C99, which is still a goal of ours.  I like
> RU's suggestion, because it is straight C[99] code and not an
> abstraction.  I'll do a 'make world' test and see if we'd have trouble
> with RU's form.
> 
The code I've posted has obvious troubles.  It would take care
of the following fragment for -std=c89 and be pure C99 for
-std=c99,

void
foo(char * restrict fa)
{
}

but will break this for -std=c89:

void
restrict(void)
{
}

We have a problem if we want to mix old C89 and new C99 code.


Cheers,
-- 
Ruslan Ermilov
FreeBSD committer
ru at FreeBSD.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20040117/b4665442/attachment.bin


More information about the freebsd-hackers mailing list