This is the mail archive of the 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: [patch, rfc] Semantics of attribute (aligned), misscompilation of crtstuff

Daniel Jacobowitz wrote:
> On Tue, Oct 23, 2007 at 03:50:15PM +0200, Zdenek Dvorak wrote:
>>> How about __attribute__((aligned(sizeof(func_ptr)),packed)) instead of
>>> the runtime test?
>> do we support attribute packed on variables? I get
>> ../../gcc/gcc/crtstuff.c:196: warning: ?packed? attribute ignored
>> ../../gcc/gcc/crtstuff.c:209: warning: ?packed? attribute ignored
>> when I try to use it.
> :-(
> The documentation isn't clear... it reads like that should work
> (and be right).

I think this is a documentation bug.  In particular, the manual does not
list "packed" under "Variable Attributes" -- but it does say, in the
description of the "aligned" attribute that "packed" can decrease
alignment.  Is that what suggested to you that the combination was
valid?  I think what's happened is that the "aligned" documentation is
shared between "Type Attributes" and "Variable Attributes"; we probably
need to change the "Variable Attributes" copy not to mention "packed"
since it doesn't make sense in this context.

Mark Mitchell
(650) 331-3385 x713

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