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: On alignment


Jason Merrill <jason@redhat.com> writes:

| On 02 May 2003 15:07:54 +0200, Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:
| 
| > Tom Tromey <tromey@redhat.com> writes:
| >
| > [...]
| >
| > | What will eventually go wrong with what we have now?
| > | 
| > |     template<typename T>
| > |     struct aligner
| > |     {
| > |       T field;
| > |     };
| > | 
| > |     #define ALIGNOF(TYPE) (__alignof__ (((aligner<TYPE> *) 0)->field))
| >
| > This, as I understand it from my previous attempt, won't give you the
| > right answer (for double, it would give 8 instead of 4).
| 
| It will give you the right answer on the trunk (and I just checked in a
| patch so it will give you the right answer in 3.3 as well).

OK, many thanks.

-- Gaby


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