Packed structures

John Love-Jensen eljay@adobe.com
Wed Jul 2 14:08:00 GMT 2003


Hi Gusti,

The "__attribute__((packed))" is not portable between different compilers.
And may lead to code that creates bus errors on certain platforms.

Treating everything as bytes, and having glue routines that pack/unpack them
appropriately, defends against bus errors, doesn't rely on compiler
extensions, and is more portable.

--Eljay



More information about the Gcc-help mailing list