-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Open
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partyVerified by a second partyfalse-negativeWarning doesn't fire when it shouldWarning doesn't fire when it should
Description
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?
dwblaikie and Hoernchen
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partyVerified by a second partyfalse-negativeWarning doesn't fire when it shouldWarning doesn't fire when it should