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: gcc 2.95/C: flexible array member as error, breaks ISO C


> However your proposed work-around is specifically prohibited at ISO 6.7.5.2
> (constant array dimension must be > 0). 

Yes, that's a GNU C extension. 'gcc -pedantic' should diagnose it as
such.

> I went for 
> 
> #ifdef __GNUC__
>  	ClnpT_MacIf		mac_intf_tbl[1];
> #else
>  	ClnpT_MacIf		mac_intf_tbl[];
> #endif
> 
> This is fine except that an array bounds check might fail.

This is indeed the obvious approach.

Regards,
Martin

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