This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What does zero-length array mean at file scope?
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Dave Korn <dave dot korn dot cygwin at googlemail dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 29 May 2009 00:16:25 +0100
- Subject: Re: What does zero-length array mean at file scope?
- References: <4A189BCD.1090707@gmail.com> <Pine.LNX.4.64.0905282059070.24872@digraph.polyomino.org.uk>
Joseph S. Myers wrote:
> On Sun, 24 May 2009, Dave Korn wrote:
>
>> So, is the testcase invalid, and should the compiler be warning about this
>> declaration? I couldn't get any complaint out of it even with "-W -Wall
>> -Wextra -pedantic -std=c89"? Or should the linker be allocating some space
>> for this zero-sized common?
>
> I get "warning: ISO C forbids zero-size array 'i0'" with -pedantic.
>
Err. Yes, so do I now. It turns out you can't just tack a -W on a
cut-n-pasted command line to cancel out an earlier -w.
cheers,
DaveK