This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/23658] New: bogus warning for missing return value
- From: "gdr at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Aug 2005 16:23:23 -0000
- Subject: [Bug c/23658] New: bogus warning for missing return value
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The testcase below was distilled from GMP source code (thanks to TG).
Consider
inline int foo (void){ if (1) return 0; }
int bar () { return foo (); }
compile with "-Wall -O2 -c". Gcc spits out
tg.c: In function 'bar':
tg.c:2: warning: control may reach end of non-void function 'foo' being inlined
which clearly is bogus as the branch is *always* taken.
--
Summary: bogus warning for missing return value
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gdr at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: platform independent
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23658