This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: __restrict for arrays
- To: Matt Kraai <kraai at alumni dot carnegiemellon dot edu>
- Subject: Re: __restrict for arrays
- From: Andreas Jaeger <aj at suse dot de>
- Date: 05 Jun 2001 08:28:26 +0200
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <20010604222304.A450@brandx.net>
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