On 04/22/2018 01:17 PM, dave.pa...@oracle.com wrote: > This patch fixes handling of -Werror=return-type as well as > -Wno-return-type. Currently, -Werror=return-type does not turn the > warnings into errors and -Wno-return-type does not turn off > warning/error. Now they both work as expected. > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55976 > > Initialize warn_return_type only for C++/C++ with ObjC extensions. In C, > this allows us to differentiate between default (no option), or cases > where -Wreturn-type/-Wno-return-type are specified. Elsewhere, update > references to warn_return_type (for C) to reflect change in initialization. > > Patch was successfully bootstrapped and tested on x86_64-linux. > > --Dave > > > CL-55976 > > > /c > 2018-04-22 David Pagan <dave.pa...@oracle.com> > > PR c/55976 > * c-decl.c (grokdeclarator): Update check for return type warnings. > (start_function): Likewise. > (finish_function): Likewise. > * c-typeck.c (c_finish_return): Update check for return type warnings. > Pass OPT_Wreturn_type to pedwarn when appropriate. > * c-opts.c (c_common_post_options): Set default for warn_return_type > for C++/C++ with ObjC extensions only. For C, makes it possible to > differentiate between default (no option), -Wreturn-type, and > -Wno-return-type. > > /testsuite > 2018-04-22 David Pagan <dave.pa...@oracle.com> > > PR c/55976 > * gcc.dg/noncompile/pr55976-1.c: New test. > * gcc.dg/noncompile/pr55976-2.c: New test. THanks. Installed on the trunk.
Sorry for the long delay, Jeff