This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31783] New: [4.1.2, 4.1.1] bogus "control reaches end of non-void function" warning
- From: "wad at infinet dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 May 2007 03:00:55 -0000
- Subject: [Bug c++/31783] New: [4.1.2, 4.1.1] bogus "control reaches end of non-void function" warning
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
gcc 4.1.2 and gcc 4.1.1 shows the following bogus warning message.
[wad@hius ~/tests] arm-rtems-gcc -Os -Wall -S test.cpp
test.cpp: In member function 'int attr::create(int)':
test.cpp:17: warning: control reaches end of non-void function
the minimal testcase:
class attr
{
attr() {}
~attr() {}
int create(int);
};
int attr::create(int c)
{
attr p;
switch(c)
{
default:
return 123;
break;
}
}
--
Summary: [4.1.2, 4.1.1] bogus "control reaches end of non-void
function" warning
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: wad at infinet dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31783