This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/32260] New: too many warning: dereferencing type-punned pointer will break strict-aliasing rules
- From: "sylvain dot pion at sophia dot inria dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jun 2007 18:44:02 -0000
- Subject: [Bug c++/32260] New: too many warning: dereferencing type-punned pointer will break strict-aliasing rules
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code, compiled with -O2 -Wall (g++ 4.3 as of 20070607),
produces the following unexpected/annoying warning:
test_typeinfo.cpp: In function 'int main()':
test_typeinfo.cpp:5: warning: dereferencing type-punned pointer will break
strict-aliasing rules
test_typeinfo.cpp:5: warning: unused variable 't'
~> cat test_typeinfo.cpp
#include <typeinfo>
int main()
{
const std::type_info & t = typeid(int);
}
Is this really meant to warn for such a code???
--
Summary: too many warning: dereferencing type-punned pointer will
break strict-aliasing rules
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sylvain dot pion at sophia dot inria dot fr
GCC host triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32260