-Waddress-of-packed-member flags attribute(packed) but not pragma pack #97091
Labels
clang:diagnostics
New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
confirmed
Verified by a second party
false-negative
In this example, there are two packed (and thus unaligned) structs, both of whom have an
int
field where taking the address is dangerous, as I understand it:https://godbolt.org/z/PdqaMoeof
But for some reason,
-Waddress-of-packed-member
only flags the first one, and not the second. Is that intentional? I think they both run afoul of pointer alignment requirements. I noticed #23195 was filed back in 2016, but it was closed on grounds that Clang doesn't accept#pragma pack
.It seems Clang now does, but the warning was never updated?
The text was updated successfully, but these errors were encountered: