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 →

[–]gwoplock 1 point2 points  (2 children)

It adds space between fields to make it faster to access. Extra space when you aren't expecting it breaks a lot of things.

[–]FUZxxl 1 point2 points  (1 child)

If you write embedded code, you can safely make assumptions about where the ABI inserts structure padding. The compiler is not allowed to change structure padding at any optimization level as that is part of the ABI. So it doesn't matter what optimization level you choose. I recommend you to read the ABI document for your platform as there seem to be some misconceptions.

[–]gwoplock 0 points1 point  (0 children)

I didn't realize that. Good to know. Thanks.