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: C ABI: struct/union inconsistency




--On Friday, September 27, 2002 04:08:48 PM -0700 Richard Henderson <rth@redhat.com> wrote:

On Fri, Sep 27, 2002 at 02:06:49PM -0700, Mark Mitchell wrote:
Why not ask the kernel developers about something like:

 struct S __attribute__((possibly_empty)) {};

?

The idea being that if S has no members, the size ends up zero.
As it happens, something like this was independently suggested
by Alan Cox, so it seems that this is a reasonable solution.
Good.  I agree with the other suggestions you make, such as making
zero-sized arrays keep the whole thing having size zero.  Basically,
an attribute that preserves the current behavior.

So, the biggest remaining question is what name to use for the
attribute.  I don't think "possibly_empty" is very good.

How about "tiny"?

--
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com


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