ALIGNOF

Tom Tromey tromey@redhat.com
Tue Apr 13 17:02:00 GMT 2004


>>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:

Andrew> It turns out that libgcj aligns things differently from the
Andrew> compiler.

Ugh, after all the stuff we went through last time, you'd think this
bug could stay dead.

Andrew>   struct aligner
Andrew>   {
Andrew> +   char c;
Andrew>     T field;
Andrew>   };
Andrew> ! #define ALIGNOF(TYPE) (offsetof (aligner<TYPE>, field))

Hmm, the old code gets the wrong answer for `double'.  And that was
explicitly mentioned in the thread last year.  You'd think I would
have noticed it then.

We really need tests in this area.

Tom



More information about the Java-patches mailing list