On Mon, 11 Apr 2016, Prasad Ghangal wrote: > Hi! > > This is proposed patch for > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48116 (-Wreturn-type does > not work as advertised)
I think that this is actually a documentation bug and should be fixed by changing the documentation, not by changing the code. That is, the patch <https://gcc.gnu.org/ml/gcc-patches/2007-02/msg01102.html> that added the assertion about return with a value from functions returning void was mistaken: if the expression is non-void, the diagnostic is mandatory, and if it's a void expression, this is a legitimate, long-standing extension to ISO C, taken from ISO C++, and should be documented as such and not warned for except with -pedantic. So there should be two documentation changes: (a) correct the description of -Wreturn-type and (b) explicitly document return of void expressions from functions returning void as a GNU C extension taken from ISO C++. -- Joseph S. Myers jos...@codesourcery.com