List Info

Thread: Re: __restrict and arrays




Re: __restrict and arrays
country flaguser name
United States
2007-06-17 13:02:41
In article <20070617020826.A80C2D2B88Fmail.connecty.lt>,
Mindaugas R. <rmindNetBSD.org> wrote:
>Hello,
>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
>#else
>#define	__restrict_array	/* Nothing */
>#endif
>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.

christos


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )