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
This commit is contained in:
Joseph Myers 2000-11-13 20:00:22 +00:00 committed by Joseph Myers
parent 29b10746ab
commit ebf025238d
5 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,8 @@
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>
* cpplex.c (_cpp_lex_token): CPP_COMMENT and true CPP_EOF

View File

@ -1584,8 +1584,7 @@ stmts_and_decls:
| lineno_stmt_decl_or_labels_ending_decl
| lineno_stmt_decl_or_labels_ending_label
{
if (pedantic)
pedwarn ("ISO C forbids label at end of compound statement");
pedwarn ("deprecated use of label at end of compound statement");
}
| lineno_stmt_decl_or_labels_ending_error
;

View File

@ -1,3 +1,8 @@
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>
* gcc.c-torture/execute/loop-7.c: New test.

View File

@ -10,6 +10,6 @@ bar (int64_t which)
break;
case 1 :
case 5 :
case 2 :
case 2 : ;
}
}

View File

@ -25,7 +25,7 @@ testfunc1 (int foo6)
testfunc1: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
a: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
i:
j:
j: ;
}
#line 32 "sys-header.h" 3
@ -46,5 +46,5 @@ testfunc2 (int foo6)
testfunc2:
a:
i:
j:
j: ;
}