diff options
-rw-r--r-- | cparser/pre_parser.mly | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cparser/pre_parser.mly b/cparser/pre_parser.mly index f3bfb9e8..96cf0de7 100644 --- a/cparser/pre_parser.mly +++ b/cparser/pre_parser.mly @@ -870,14 +870,19 @@ function_definition_begin: | declaration_specifiers(declaration(external_declaration)) ilist(pointer1) x=direct_declarator { match x with - | (_, None) -> $syntaxerror + | (_, None) -> !open_context() + (* this case does not make sense, but we let it pass anyway; + this error will be caught later on by a type check *) | (i, Some restore_fun) -> restore_fun () } | declaration_specifiers(declaration(external_declaration)) ilist(pointer1) x=direct_declarator LPAREN params=identifier_list RPAREN open_context declaration_list { match x with - | (_, Some _) -> $syntaxerror + | (i, Some _) -> declare_varname i + (* this case does not make sense; the syntax of K&R + declarators is broken anyway, Jacques-Henri should + propose a fix soon *) | (i, None) -> declare_varname i; List.iter declare_varname params |