This is the mail archive of the gcc@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: What does zero-length array mean at file scope?


On Sun, 24 May 2009, Andrew Haley wrote:

> Of course we have to fix the assembler output.  For ant two declarations
> a and b, &a != &b, even when a is a zero-length array.  So, you have to
> allocate at least one byte.

I don't think this is necessarily part of the semantics for the GNU 
extensions of zero-length arrays and empty structures.  Certainly when 
they are used in the middle of a structure they are not expected to take 
up any space (so their address may be the same as that of the next 
member).

-- 
Joseph S. Myers
joseph@codesourcery.com


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