Sergei Sharonov wrote:
Hi,
Packed structures definitely have their use. For example when you
exchange data between different architectures (networks, etc.) Yes, you
take a performance hit in memory access, but in many case you will find
out that it is just a matter if it is you who pack/unpack it manually or
a compiler doing it for you. I agree that sometimes you can play games
with structure member ordering but it is not always up to us to decide
on it (e.g. foreign data).
BTW, I believe default structure packing/ordering is not specified by
any standard (?) - it is "try and see" what the compiler did.
yepp, exactly
under
"6.7.2.1 Structure and union specifiers" from the c standards it says:
12 Each non-bit-field member of a structure or union object is aligned in an
implementationdefined manner appropriate to its type.
Greetz,
Georg
Sergei
-----Original Message-----
From: [email protected]
...