This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/48116] New: -Wreturn-type does not work as advertised
- From: "tromey at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Mar 2011 17:08:34 +0000
- Subject: [Bug c/48116] New: -Wreturn-type does not work as advertised
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48116
Summary: -Wreturn-type does not work as advertised
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: tromey@gcc.gnu.org
I'm using svn trunk gcc as of today.
-Wreturn-type is documented as:
[... warn] about a `return' statement with a expression
in a function whose return-type is `void'.
I tried it with this test case:
void x (void) { }
void y(void) { return x(); }
I expected a warning on the `return', but did not get one:
I used "gcc -Wreturn-type -O2 -c q.c"