[Bug c++/106873] unsigned short skips byte when used for memory mapping depending on position in structure
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Sep 7 16:28:02 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106873
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Which I think is what you are missing is that the ABI is layed out this way.
The reason why it is layout this way is for alignment reasons. In many ABIs,
the alignment of short is 2 bytes; the natural alignment.
More information about the Gcc-bugs
mailing list