This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Broken C array autosizing breaks glibc compile
- To: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Subject: Re: Broken C array autosizing breaks glibc compile
- From: Kaz Kylheku <kaz at ashi dot footprints dot net>
- Date: Thu, 21 Sep 2000 15:08:39 -0700 (PDT)
- cc: gcc-bugs at gcc dot gnu dot org, libc-alpha at sources dot redhat dot com
On Thu, 21 Sep 2000, Franz Sirl wrote:
> > The only reasonable thing would be for the compiler to emit a diagnostic,
> > like ``too many elements in initializer for array dimension''.
>
> Well, I seemed to remember this is a GCC extension (especially since -Wall
> didn't warn and it was working with earlier compilers), but looking in the
> docs I cannot find it...
>
> So if it's no GCC extension, the bug is in glibc's repertoire.c.
I believe it's an extension, but it's only useful in structs, where the
array declaration creates a ghost pseudo-member for generating a pointer to the
region of memory where an array would otherwise have been placed. So it can be
used, e.g. as a refinement to the ``struct hack'':
struct header {
size_t size;
int type;
char variable_data[0];
};