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 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~


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