public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32260]  New: too many warning: dereferencing type-punned pointer will break strict-aliasing rules
@ 2007-06-08 18:44 sylvain dot pion at sophia dot inria dot fr
  2007-06-11 21:19 ` [Bug c++/32260] [4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: sylvain dot pion at sophia dot inria dot fr @ 2007-06-08 18:44 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-11-11 14:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-08 18:44 [Bug c++/32260] New: too many warning: dereferencing type-punned pointer will break strict-aliasing rules sylvain dot pion at sophia dot inria dot fr
2007-06-11 21:19 ` [Bug c++/32260] [4.3 Regression] " pinskia at gcc dot gnu dot org
2007-06-29 18:43 ` mmitchel at gcc dot gnu dot org
2007-09-28 17:04 ` pcarlini at suse dot de
2007-10-26  9:01 ` pcarlini at suse dot de
2007-11-01 11:57 ` jakub at gcc dot gnu dot org
2007-11-01 22:51 ` jakub at gcc dot gnu dot org
2007-11-01 23:09 ` jakub at gcc dot gnu dot org
2007-11-11 14:04 ` pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).