Subject: __restrict and arrays
To: None <,>
From: Mindaugas R. <>
List: tech-userlevel
Date: 06/17/2007 05:06:15
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 *

Any suggestions?

Best regards,