[Bug c/51628] __attribute__((packed)) is unsafe in some cases

sven.koehler at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Nov 2 13:05:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51628

--- Comment #31 from Sven <sven.koehler at gmail dot com> ---
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.


More information about the Gcc-bugs mailing list