This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C ABI: struct/union inconsistency
- From: Richard Henderson <rth at redhat dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: "tim at hollebeek dot com" <tim at hollebeek dot com>, "David S. Miller" <davem at redhat dot com>, "gdr at integrable-solutions dot net" <gdr at integrable-solutions dot net>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sat, 28 Sep 2002 12:23:25 -0700
- Subject: Re: C ABI: struct/union inconsistency
- References: <20020928100655.A10847@hollebeek.com> <48190000.1033234561@warlock.codesourcery.com>
On Sat, Sep 28, 2002 at 10:36:01AM -0700, Mark Mitchell wrote:
> >Don't we already have (or recently discuss) an attribute to eliminate
> >tail padding? Shouldn't that get used here?
>
> Yes, I realized last night that attribute((nopadding)) is the right
> answer to this question. I'd been meaning to implement that anyhow;
> this is an opportune excuse.
No, that's not what we want.
struct foo {
#ifdef SMP
long long count;
long lock;
#endif
};
Here, attribute((nopadding)) would leave foo with size 12,
instead of the required size 16 when SMP is defined.
We _only_ want to change the zero-size-ness of this struct.
r~