This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: On alignment
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Jason Merrill <jason at redhat dot com>
- Cc: tromey at redhat dot com, Andrew Haley <aph at redhat dot com>, Jamie Lokier <jamie at shareable dot org>, gcc at gcc dot gnu dot org
- Date: 08 May 2003 11:57:26 +0200
- Subject: Re: On alignment
- Organization: Integrable Solutions
- References: <200303251122.13693.kevin.hendricks@sympatico.ca><wvl1y0vmhdv.fsf@prospero.boston.redhat.com><wvlu1drl2kl.fsf@prospero.boston.redhat.com><200303251344.59988.kevin.hendricks@sympatico.ca><wvlhe9rkzgm.fsf@prospero.boston.redhat.com><16037.6826.35777.756256@cuddles.redhat.com><jen0ii4x27.fsf@sykes.suse.de><20030423124944.GA24593@mail.jlokier.co.uk><87wuhlgq5l.fsf@fleche.redhat.com><wvlu1cpdv7s.fsf@prospero.boston.redhat.com><87lly1f5ir.fsf@fleche.redhat.com><wvllly1dq6q.fsf@prospero.boston.redhat.com><m3ist5auzc.fsf@uniton.integrable-solutions.net><87sms9dmuy.fsf@fleche.redhat.com><wvlptncd0i2.fsf@prospero.boston.redhat.com><16039.44856.826662.680167@cuddles.redhat.com><87znm6utca.fsf@fleche.redhat.com><m3llxpo5sl.fsf@uniton.integrable-solutions.net><wvld6ixe94o.fsf@prospero.boston.redhat.com>
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