Subject: Re: __restrict and arrays
To: None <>
From: Christos Zoulas <>
List: tech-userlevel
Date: 06/17/2007 18:02:41
In article <>,
Mindaugas R. <> wrote:
>there is an issue with GCC 3.x and aio.h file. This header contains such line:
>int	lio_listio(int, struct aiocb * const __restrict [],
>		    int, struct sigevent * __restrict);
>There should be a C99 specifier "[__restrict]", which is actually not
>compatible with older GCC versions than 3.1.  I am not sure what would be an
>appropriate way to fix this...
>a) Declare something like __restrict_array macro in sys/cdefs.h :
>#if __GNUC_PREREQ__(3, 1)
>#define	__restrict_array	__restrict
>#define	__restrict_array	/* Nothing */
>It would be used as:
>	struct aiocb * const [__restrict_array]
>b) Instead, use something like:
>	struct aiocb * const __restrict *

I think b is better because it is simpler. Unless the standards mandate
an array.