projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6fe356f
)
Generate a more sensible warning for a stray ; in global context than "no type specif...
author
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 11 Dec 2007 08:53:49 +0000
(08:53 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 11 Dec 2007 08:53:49 +0000
(08:53 +0000)
[r18669]
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/parser.c
index
387681d
..
71f125b
100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-5337,7
+5337,13
@@
static translation_unit_t *parse_translation_unit(void)
initialize_builtin_types();
while(token.type != T_EOF) {
- parse_external_declaration();
+ if (token.type == ';') {
+ /* TODO error in strict mode */
+ warningf(HERE, "stray ';' outside of function");
+ next_token();
+ } else {
+ parse_external_declaration();
+ }
}
assert(context == &unit->context);