OSDN Git Service

* c-parse.in (stmts_and_decls): Deprecate use of label at end of
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Nov 2000 20:00:22 +0000 (20:00 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Nov 2000 20:00:22 +0000 (20:00 +0000)
compound statement.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37435 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-parse.in
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/990214-1.c
gcc/testsuite/gcc.dg/wtr-label-1.c

index e980c45..bf184f5 100644 (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
index 0f3d2ab..288d248 100644 (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
        ;
index 3cd833b..16e51fd 100644 (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.
index 5701b5d..492c6a7 100644 (file)
@@ -10,6 +10,6 @@ bar (int64_t which)
                break;
        case 1 :
        case 5 :
-       case 2 :
+       case 2 : ;
        }
 }
index 8c7d73a..98f3eeb 100644 (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: ;
 }