DECL_ALIGN

Neil Booth neil@daikokuya.demon.co.uk
Tue Jan 22 16:56:00 GMT 2002


tree.h has the following comment for DECL_ALIGN:

/* Holds the alignment required for the datum, in bits.  */

Is the use of the word "required" correct here?  Or should it
say

/* Holds the known alignment for the datum, in bits.  */

The reason I'm asking is that the GCC documentation of
__alignof__ states that, for an lvalue, it returns the *known*
alignment of the variable.  But it uses DECL_ALIGN to get
its result.  These are different for the example given in the
documention:

struct foo @{ int x; char y; @} foo1;

Recent GCCs seem to give 1 for __alignof__ (foo1.y); but
the docs claim it should be 4 (for x86 at least).

Is the bug in the code or the docs?

Neil.



More information about the Gcc mailing list