On Wed, Mar 16, 2011 at 11:18:04AM -0600, Tom Tromey wrote: > This patch fixes PR c/48116. > > The bug is that -Wreturn-type does not follow the documentation. In > particular, it should warn for this code, but does not: > > static void f() {} > static void g() { return f(); } > > I think the bug is that c-typeck.c calls pedwarn with either 0 or > OPT_pedantic, but it should use OPT_Wreturn_type in some cases.
I think it is wrong if -Wreturn-type, which is enabled by default in -Wall, warns about the above. Returning a void value in a void function is a GNU extension, which is heavily used in various projects. Warning about this just with -pedantic is IMHO the right thing to do. Jakub