This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: ALIGNOF


Tom Tromey writes:
 > >>>>> "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.

Yeah.  :-)

 > 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.

It's incredibly hard to test.  I think this solution is right for all
our platforms...

Andrew.


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