Re: Data structure alignment question

From: Marc S. Gibian (marc.gibian@acm.org)
Date: 04/16/03


From: marc.gibian@acm.org (Marc S. Gibian)
Date: 15 Apr 2003 18:05:57 -0700

Interestingly, today I ran into a new occurance of this alignment
problem on a platform that had previously been aligning properly. The
only change that I know of was the the system was reinstalled after a
disk crash and I installed GCC 3.2.2 rather than its much older GCC
2.7.? that it was using before the crash. To make things even more
interesting, this platform is running SCO OpenServer 5.0.5 on a I686
platform, so the alignment issue is happening in this case on a 32-bit
machine. This suggests rather strongly that the problem I've been
having on Tru64 is not a matter of porting to our first 64-bit
platform, but rather an issue with our first (and now second) GCC
3.2.2 platform.



Relevant Pages

  • Re: Forth seems very cool, but a little perspective, please!
    ... If you can do things that don't require you to know your platform, ... cell data first your alignment problems disappear. ... you unalign it. ...
    (comp.lang.forth)
  • Re: Why #pragma pack() not take effect?
    ... What compiler on which platform are you using? ... maximum alignment (that is, ... You seem to actually want padding instead of packing. ... same structure as on a 64-bit platform such as HP-UX ia64. ...
    (comp.unix.programmer)
  • Re: Sergey P. Derevyago -VS- vzmem...
    ... > on my 32-bit x86 platform with MSVC and GCC, doubles need stricter> alignment ... your allocator will cause undefined> behavior ... On such platform user is ... Well, on my MSVC 8, the following program outputs OH CRAP! ...
    (comp.programming.threads)
  • Re: Sergey P. Derevyago -VS- vzmem...
    ... On such platform user is ... free to allocate memory with custom memory allocator, ... alignment 16. ... Well, on my MSVC 8, the following program outputs OH CRAP! ...
    (comp.programming.threads)
  • Re: some interview questions.
    ... > the specified platform the alignment is on 4 byte boundaries. ... This is very platform dependent. ... structures on a 16 bit platform with 2 byte ints to give an answer of 5, ... d dot neary at phenix dot fr ...
    (comp.lang.c)