]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-decl.c (finish_function): Suppress "control reaches end of non-void function" when...
authorJan Hubicka <jh@suse.cz>
Fri, 13 May 2005 14:00:55 +0000 (16:00 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 13 May 2005 14:00:55 +0000 (14:00 +0000)
* c-decl.c (finish_function): Suppress "control reaches end of
non-void function" when "no return statement in function
returning non-void" is issued.

From-SVN: r99659

gcc/ChangeLog
gcc/c-decl.c

index 61d986100ed1de5429210612cfae811a8ce932d5..03261dc1e790f32cac61f805c5d5cba0b1028101 100644 (file)
@@ -1,5 +1,9 @@
 2005-05-13  Jan Hubicka  <jh@suse.cz>
 
+       * c-decl.c (finish_function): Suppress "control reaches end of
+       non-void function" when "no return statement in function
+       returning non-void" is issued.
+
        * tree-inline.c (copy_body_r): Simplify substituted ADDR_EXPRs.
        * tree-optimize.c (pass_gimple): Kill.
        (init_tree_optimization_passes): Kill pass_gimple.
index 6c9ab457510740328ee894d260fb040804d7b3f8..e189d3629dd363d29338dea15bbacaac66cda8ae 100644 (file)
@@ -6490,7 +6490,10 @@ finish_function (void)
       /* Normally, with -Wreturn-type, flow will complain.  Unless we're an
         inline function, as we might never be compiled separately.  */
       && DECL_INLINE (fndecl))
-    warning (0, "no return statement in function returning non-void");
+    {
+      warning (0, "no return statement in function returning non-void");
+      TREE_NO_WARNING (fndecl) = 1;
+    }
 
   /* With just -Wextra, complain only if function returns both with
      and without a value.  */