[Bug c/51628] __attribute__((packed)) is unsafe in some cases
hjl.tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Nov 2 13:11:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51628
--- Comment #32 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Sven from comment #31)
> https://gcc.gnu.org/viewcvs/gcc/trunk/?view=log&pathrev=251180
>
> I am reading the commit message, and the example doesn't make any sense.
> The aligned attribute is for providing additional alignment guarantees in
> addition to the types default alignment. In particular, the documentation of
> the aligned type attribute specifically states, that this attribute cannot
> decrease alignment. It can only _increase_ alignment.
>
> In particular, aligned(4) in combination with a 64bit type makes little
> sense.
long long is aligned to 4 bytes in struct for i386.
More information about the Gcc-bugs
mailing list