(stmt): Warn about `goto *expr;' if pedantic.
authorPaul Eggert <eggert@gnu.org>
Fri, 2 Feb 1996 17:42:40 +0000 (17:42 +0000)
committerPaul Eggert <eggert@gnu.org>
Fri, 2 Feb 1996 17:42:40 +0000 (17:42 +0000)
(label): Warn about `case expr ... expr:' if pedantic.

From-SVN: r11160

gcc/c-parse.in

index 044e452324956a966b05dddc00c0878ba2b4c61b..41fb8aaf6aeec829b31e30a9f3349ed8b175bd51 100644 (file)
@@ -1919,7 +1919,9 @@ stmt:
                    }
                }
        | GOTO '*' expr ';'
-               { stmt_count++;
+               { if (pedantic)
+                   pedwarn ("ANSI C forbids `goto *expr;'");
+                 stmt_count++;
                  emit_line_note ($<filename>-1, $<lineno>0);
                  expand_computed_goto (convert (ptr_type_node, $3)); }
        | ';'
@@ -2018,6 +2020,8 @@ label:      CASE expr_no_commas ':'
                  register tree label
                    = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
 
+                 if (pedantic)
+                   pedwarn ("ANSI C forbids case ranges");
                  stmt_count++;
 
                  if (value1 != error_mark_node && value2 != error_mark_node)