[Bug c/88583] -Wpacked-not-aligned shouldn't be in -Wall
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Dec 23 19:45:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88583
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The kernel should just fix the code rather than disabling the warning. My bet
is the kernel developers don't understand the warning correctly.
This is to warn about structs which are marked as aligned but included in
structs which have the packed attribute on it. Which can cause incorrect
behavior if used incorrectly.
NOTE x86 is not the issue here but rather if the developer took the address of
that field, and then used it with the aligned struct, GCC will "incorrectly"
assume the alignment that is of the aligned struct (and might optimize out
alignment checks, etc.).
More information about the Gcc-bugs
mailing list