This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14024] New: g++ isn't reporting aliasing warnings
- From: "tjw at omnigroup dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Feb 2004 04:48:26 -0000
- Subject: [Bug c++/14024] New: g++ isn't reporting aliasing warnings
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
int test(int input)
{
float *f = (float *)&input;
return input;
}
When built with gcc:
$PREFIX/bin/gcc -Wstrict-aliasing -fstrict-aliasing -c alias.c
/tmp/alias.c: In function `test':
/tmp/alias.c:3: warning: dereferencing type-punned pointer will break strict-aliasing rules
But, when the same input is built with g++, no warning is issued. This is bad since -fstrict-aliasing
does seem to be taking effect (i.e., my real program produces crazy output with -fstrict-aliasing
on), but no warnings are generating, meaning that it will be potentially very hard to track down the
issue.
--
Summary: g++ isn't reporting aliasing warnings
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tjw at omnigroup dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc-apple-darwin7.2.0
GCC host triplet: powerpc-apple-darwin7.2.0
GCC target triplet: powerpc-apple-darwin7.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14024