c-decl.c
359 KB
-
re PR c/55976 (-Werror=return-type should error on returning a value from a void function) · b67b9225
2018-05-30 David Pagan <dave.pagan@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. PR c/55976 * 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. PR c/55976 * gcc.dg/noncompile/pr55976-1.c: New test. * gcc.dg/noncompile/pr55976-2.c: New test. From-SVN: r260978
David Pagan committed