This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Broken C array autosizing breaks glibc compile


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];
	};


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]