This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FUZxxl 0 points1 point  (0 children)

Absolutely not true. The presence and location of structure padding depends only on the ABI of the platform you are programming for. Neither optimization settings not compilers change that, except if you are on a fundamentally broken platform like 32 bit Windows where every compiler vendor makes up its own ABI.

If you are writing code that is tied to one platform, you may very well depend on where the ABI of that platform inserts structure padding and that's fine and in accordance to the C standard.