This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Zero-length arrays
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: Zero-length arrays
- From: Linus Torvalds <torvalds at transmeta dot com>
- Date: Thu, 4 Jan 2001 14:04:25 -0800 (PST)
- cc: drepper at cygnus dot com, drepper at redhat dot com, rth at redhat dot com, gcc-patches at gcc dot gnu dot org
On Thu, 4 Jan 2001, Mark Mitchell wrote:
>
> The usual heavy extension users are the Linux kernel and the C
> library. Do y'all actually do this kind of initialization for
> statically allocated objects?
The suggested syntax from Richard would be my personal favourite by far:
it makes sense. So absolutely no complaints from kernel-land.
(I'd also love to get the warning about "extra elements" in general).
I think it's mainly glibc that may have some of the
int x[0] = { 1, 2, 3, 4 };
type initializers, simply because that was historically the only way to do
them in gcc (horribly ugly, and apparently it took advantage of what could
best be characterized as a gcc oversight, but hey, the code is out there).
Linus