Re: Absurd declarations, and how gcc deals with them.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Sisyphus" <sisyphus1@xxxxxxxxxxxxxxx> writes:

> I have some auto-generated C code that contains declarations like:
>
>    int x[0];
>    int y[] = {};

> What does gcc-3.x.x do with declarations like that (and why) ?

gcc supports empty arrays as an extension to the C language.  It
should reject that code if you compile with -pedantic.  Empty arrays
are mainly useful as the last field of a struct.

This language extension is even documented in the fine manual.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux