diff options
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 927fa91..ee0c559 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2019-07-18 Richard Sandiford <richard.sandiford@arm.com> + + PR c/53633 + * c-decl.c (finish_function): Check targetm.warn_func_return + before issuing a -Wreturn-type warning. + 2019-07-12 Alexandre Oliva <oliva@adacore.com> * gimple-parser.c (c_parser_gimple_try_stmt): New. diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index d75648a..0d107ad 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -9687,6 +9687,7 @@ finish_function (void) /* Normally, with -Wreturn-type, flow will complain, but we might optimize out static functions. */ && !TREE_PUBLIC (fndecl) + && targetm.warn_func_return (fndecl) && warning (OPT_Wreturn_type, "no return statement in function returning non-void")) TREE_NO_WARNING (fndecl) = 1; |