Commit ebf02523 by Joseph Myers Committed by Joseph Myers

c-parse.in (stmts_and_decls): Deprecate use of label at end of compound statement.

	* c-parse.in (stmts_and_decls): Deprecate use of label at end of
	compound statement.

testsuite:
	* gcc.dg/wtr-label-1.c, gcc.dg/990214-1.c: Add semicolons after
	labels at end of compound statements.

From-SVN: r37435
parent 29b10746
2000-11-13 Joseph S. Myers <jsm28@cam.ac.uk>
* c-parse.in (stmts_and_decls): Deprecate use of label at end of
compound statement.
2000-11-13 Neil Booth <neilb@earthling.net> 2000-11-13 Neil Booth <neilb@earthling.net>
* cpplex.c (_cpp_lex_token): CPP_COMMENT and true CPP_EOF * cpplex.c (_cpp_lex_token): CPP_COMMENT and true CPP_EOF
......
...@@ -1584,8 +1584,7 @@ stmts_and_decls: ...@@ -1584,8 +1584,7 @@ stmts_and_decls:
| lineno_stmt_decl_or_labels_ending_decl | lineno_stmt_decl_or_labels_ending_decl
| lineno_stmt_decl_or_labels_ending_label | lineno_stmt_decl_or_labels_ending_label
{ {
if (pedantic) pedwarn ("deprecated use of label at end of compound statement");
pedwarn ("ISO C forbids label at end of compound statement");
} }
| lineno_stmt_decl_or_labels_ending_error | lineno_stmt_decl_or_labels_ending_error
; ;
......
2000-11-13 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.dg/wtr-label-1.c, gcc.dg/990214-1.c: Add semicolons after
labels at end of compound statements.
2000-11-13 Jakub Jelinek <jakub@redhat.com> 2000-11-13 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/execute/loop-7.c: New test. * gcc.c-torture/execute/loop-7.c: New test.
......
...@@ -10,6 +10,6 @@ bar (int64_t which) ...@@ -10,6 +10,6 @@ bar (int64_t which)
break; break;
case 1 : case 1 :
case 5 : case 5 :
case 2 : case 2 : ;
} }
} }
...@@ -25,7 +25,7 @@ testfunc1 (int foo6) ...@@ -25,7 +25,7 @@ testfunc1 (int foo6)
testfunc1: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */ testfunc1: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
a: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */ a: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
i: i:
j: j: ;
} }
#line 32 "sys-header.h" 3 #line 32 "sys-header.h" 3
...@@ -46,5 +46,5 @@ testfunc2 (int foo6) ...@@ -46,5 +46,5 @@ testfunc2 (int foo6)
testfunc2: testfunc2:
a: a:
i: i:
j: j: ;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment