Make stray ; outside of functions an error in strict mode.
authorChristoph Mallon <christoph.mallon@gmx.de>
Thu, 18 Sep 2008 22:30:18 +0000 (22:30 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Thu, 18 Sep 2008 22:30:18 +0000 (22:30 +0000)
[r22102]

parser.c

index 14a84c4..5f76904 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -9984,10 +9984,12 @@ static void parse_translation_unit(void)
                                return;
 
                        case ';':
-                               /* TODO error in strict mode */
-                               warningf(HERE, "stray ';' outside of function");
-                               next_token();
-                               break;
+                               if (!strict_mode) {
+                                       warningf(HERE, "stray ';' outside of function");
+                                       next_token();
+                                       break;
+                               }
+                               /* FALLTHROUGH */
 
                        default:
                                errorf(HERE, "stray %K outside of function", &token);