This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/68901] UBSan triggers false -Wpadded warning
- From: "vanyacpp at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 29 Jul 2016 23:47:31 +0000
- Subject: [Bug c++/68901] UBSan triggers false -Wpadded warning
- Auto-submitted: auto-generated
- References: <bug-68901-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68901
Ivan Sorokin <vanyacpp at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vanyacpp at gmail dot com
--- Comment #1 from Ivan Sorokin <vanyacpp at gmail dot com> ---
I experienced the same issue on GCC 5.3.0. I made a minimal reprocase for the
issue.
struct mytype
{
void f()
{
value = 42;
}
unsigned value;
};
void foo()
{
mytype().f();
}
$ g++ -Wpadded -fsanitize=undefined 2.cpp
2.cpp: In member function ‘void mytype::f()’:
2.cpp:3:10: warning: padding struct size to alignment boundary [-Wpadded]
void f()
^
2.cpp: In function ‘void foo()’:
2.cpp:11:6: warning: padding struct size to alignment boundary [-Wpadded]
void foo()
^