changeset 125:2c7bdd5a49f6

supress return with no value, in function returning non-void warning on goto code segment in normal function
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 01 Apr 2018 14:05:45 +0900
parents c3a50d7877e8
children 5d30d517ebed
files gcc/c/c-parser.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gcc/c/c-parser.c	Sat Mar 31 17:18:55 2018 +0900
+++ b/gcc/c/c-parser.c	Sun Apr 01 14:05:45 2018 +0900
@@ -5637,7 +5637,13 @@
               CbC_IS_CbC_GOTO (expr.value) = 1;
               CALL_EXPR_TAILCALL (expr.value) = 1;
               add_stmt(expr.value);
+              bool warn_return_type_save = warn_return_type;
+              bool flag_isoc99_save = flag_isoc99;
+              warn_return_type = false;
+              flag_isoc99 = false;
               stmt = c_finish_return(loc, NULL_TREE, NULL_TREE); /* stmt = c_finish_return (0); */
+              warn_return_type = warn_return_type_save;
+              flag_isoc99 = flag_isoc99_save;
           }
           else
             c_parser_error (parser, "expected code segment jump or %<*%>");