Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jan 2004 17:23:01 -0800
From:      Tim Kientzle <kientzle@acm.org>
To:        "'freebsd-hackers@freebsd.org'" <freebsd-hackers@freebsd.org>
Subject:   __restrict__  vs __restrict ?
Message-ID:  <40088E75.5080908@acm.org>

next in thread | raw e-mail | index | archive | help
I've been enabling a LOT of gcc warnings recently
in the process of linting some code I'm writing.
In the process, I stumbled across the following
curiosity:

 > cat test.c
#include <stdio.h>
 > gcc -std=c99 -ansi test.c
In file included from test.c:1:
/usr/include/stdio.h:220: conflicting types for `restrict'
/usr/include/stdio.h:220: previous declaration of `restrict'
/usr/include/stdio.h:221: conflicting types for `restrict'
/usr/include/stdio.h:221: previous declaration of `restrict'
/usr/include/stdio.h:222: redefinition of `restrict'
/usr/include/stdio.h:222: `restrict' previously declared here
/usr/include/stdio.h:223: conflicting types for `restrict'
[ .... many similar lines omitted .... ]

If I change all "__restrict" in stdio.h to "__restrict__",
these warnings disappear.

Question:  Does anyone know the difference between
__restrict and __restrict__?  Should we be using
the latter in our system headers?

Tim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40088E75.5080908>