This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/38780] New: upgrade warning to error for bad C++ code ?
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jan 2009 09:45:48 -0000
- Subject: [Bug c++/38780] New: upgrade warning to error for bad C++ code ?
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I just tried to compile the following C++ code
with the GNU C++ compiler version 4.4 snapshot 20090102.
extern int f();
void
g()
{
f + 27; // should fail
}
The compiler said
bug50.cc: In function 'void g()':
bug50.cc:9: warning: pointer to a function used in arithmetic
Here is gcc 4.3.2 on the same code - this is closer
to the language definition
bug50.cc: In function 'void g()':
bug50.cc:9: error: pointer to a function used in arithmetic
I suspect that the warning in 20090102 needs to be upgraded
into a warning.
--
Summary: upgrade warning to error for bad C++ code ?
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dcb314 at hotmail dot com
GCC host triplet: x86_64-suse-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38780