This is the mail archive of the gcc-help@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]
Other format: [Raw text]

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


"Sisyphus" <sisyphus1@optusnet.com.au> 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]