C and zero-sized arrays - what is the standard?

Nathan Sidwell nathan@codesourcery.com
Thu Sep 18 13:27:00 GMT 2003


Alexandre Courbot wrote:
> Hi everybody,
> 
> Consider the following code:
> 
> struct MyStruct
> {
>     int a;
>     int b[];
> };

> Is there a portable way to do this? What is the right form according to the 
> standards?
C99 blesses '[]', calling it a flexible array member [6.7.2.1]/16

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
          The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk




More information about the Gcc-help mailing list