cochran_emc.h: packed structs

Thiago Macieira thiago at macieira.org
Tue Oct 28 12:39:19 PDT 2014


On Tuesday 28 October 2014 20:26:21 Jef Driesen wrote:
> Finally, you have the alignment and padding issues. I'm not 100% sure about 
> this, but I think that even for structures only containing 8bit integers,
> the compiler is allowed to insert padding bytes. Maybe in practice no sane
> compiler does this, but do you really want to rely on this?

It's not so far behind us.

The old ARM ABI (before EABI) did that. QChar (sizeof is 2) used to be packed 
so that the compiler would not align it to 4 bytes. In turn that meant every 
access to QChar on ARM was done byte-by-byte and reconstructed, as you can't 
do unaligned loads there.

Anyway, EABI is required these days.
-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358



More information about the subsurface mailing list