This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: __restrict for arrays


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]