aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-01-14 23:43:56 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-01-14 23:43:56 +0100
commitef5d11818dec252c1c843e82645b52ea71ab315c (patch)
treeeb13b6e69e774559a950dcafa95ea447376bfcfe /gcc/c-decl.c
parent5b1cbe1453663b9abd6df089c2882071f2335fb2 (diff)
downloadgcc-ef5d11818dec252c1c843e82645b52ea71ab315c.zip
gcc-ef5d11818dec252c1c843e82645b52ea71ab315c.tar.gz
gcc-ef5d11818dec252c1c843e82645b52ea71ab315c.tar.bz2
re PR middle-end/42674 (Bogus "no return statement in function returning non-void" warning)
PR middle-end/42674 * c-decl.c (finish_function): Don't emit -Wreturn-type warnings in functions with noreturn attribute. * decl.c (finish_function): Don't emit -Wreturn-type warnings in functions with noreturn attribute. * c-c++-common/pr42674.c: New test. From-SVN: r155920
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index a244a83..91d5884 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -8032,6 +8032,8 @@ finish_function (void)
&& !current_function_returns_value && !current_function_returns_null
/* Don't complain if we are no-return. */
&& !current_function_returns_abnormally
+ /* Don't complain if we are declared noreturn. */
+ && !TREE_THIS_VOLATILE (fndecl)
/* Don't warn for main(). */
&& !MAIN_NAME_P (DECL_NAME (fndecl))
/* Or if they didn't actually specify a return type. */