This is the mail archive of the gcc-patches@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: Document empty structures



On Monday, April 14, 2003, at 08:06 AM, Richard Earnshaw wrote:


On Fri, 11 Apr 2003, Geoffrey Keating wrote:

This adds documentation of GCC's empty structure extension.

I think there needs to be something about how empty structures interact
with initializer lists (when initializing a structure which has as an
element an empty structure): do lists of scalars ignore the empty
structure, does { } explicitly initialize it, ...?


--
Joseph S. Myers
jsm28 at cam dot ac dot uk

Some more things that also need documenting.

Yes, I agree. If you find out the answers to any of the questions, please provide a patch.


3) Do addresses of empty structures compare equal?

That's a logical consequence of them having size 0; if you have


struct empty {};

struct empty empty_array[2];

then (empty_array + 0) == (empty_array + 1)

--
Geoff Keating <geoffk at apple dot com>


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