__restrict for arrays
Andreas Jaeger
aj@suse.de
Mon Jun 4 23:34:00 GMT 2001
Matt Kraai <kraai@alumni.carnegiemellon.edu> writes:
> Looking around, I found the following in <sys/cdefs.h>:
>
> /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
> array_name[restrict]
> GCC 3.1 supports this. */
> #if __GNUC_PREREQ (3,1)
> # define __restrict_arr __restrict
>
> Some experimentation shows that the following compiles under C but
> not C++:
>
> int foo (int bar[__restrict]);
>
> Is this feature supposed to be supported in C++, or should the
> header file be changed to enable it in C only?
>
> This all shows up on a Debian sid system. Paper cuts on the
> bleeding edge, I guess. The libc6-dev package is 2.2.3-5.
That's not plain 2.2.3 - the change went in much after glibc 2.2.3 was
released! - and was fixed just a week later.
If you use CVS trees, you have to live with such problems and update
regularly. Glibc should be ok again.
Andreas
2001-05-31 Joseph S. Myers <jsm28@cam.ac.uk>
* misc/sys/cdefs.h (__restrict_arr): Define to empty for C++.
2001-05-25 Joseph S. Myers <jsm28@cam.ac.uk>
* misc/sys/cdefs.h (__restrict_arr): Define appropriately for GCC
3.1 and non-GCC C99 compilers.
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
More information about the Gcc-bugs
mailing list