diff options
author | Paul Eggert <eggert@gnu.org> | 1996-02-02 17:42:40 +0000 |
---|---|---|
committer | Paul Eggert <eggert@gnu.org> | 1996-02-02 17:42:40 +0000 |
commit | e64bb70660ba27b4834be2bd74aeb5daee765ea0 (patch) | |
tree | 01a93693fd079a791946284c34efe4fb12b6f0a5 /gcc | |
parent | 20d1e66677c3ed2a2e99067e55c92a6a9b866ab3 (diff) | |
download | gcc-e64bb70660ba27b4834be2bd74aeb5daee765ea0.zip gcc-e64bb70660ba27b4834be2bd74aeb5daee765ea0.tar.gz gcc-e64bb70660ba27b4834be2bd74aeb5daee765ea0.tar.bz2 |
(stmt): Warn about `goto *expr;' if pedantic.
(label): Warn about `case expr ... expr:' if pedantic.
From-SVN: r11160
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-parse.in | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 044e452..41fb8aa 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -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) |