[Bug c++/68901] New: UBSan triggers false -Wpadded warning
MildShoe at mailinator dot com
gcc-bugzilla@gcc.gnu.org
Mon Dec 14 21:25:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68901
Bug ID: 68901
Summary: UBSan triggers false -Wpadded warning
Product: gcc
Version: 5.2.0
URL: http://coliru.stacked-crooked.com/a/6aa2bc2bd5ef0e01
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: MildShoe at mailinator dot com
Target Milestone: ---
Host: x86_64
Target: x86_64
When compiling with -fsanitize=undefined certain structs trigger the -Wpadded
warning while without the sanitizer they do not. Judging by the values returned
by sizeof/alignof the emitted warning is actually false.
The expected size of the sample struct is 16 bytes on x86_64, with 8 byte
alignment. The expected values are printed with and without UBSan, but the
-Wpadded warning is only emitted when UBSan is enabled.
See the attached Coliru link for the code snippet and compiler options used
during compilation.
Note that this behavior is also present in GCC 4.9.x and 5.1.x
More information about the Gcc-bugs
mailing list