From 53929c981450d9f6b7d8df460e1754c9ed0def02 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 28 May 2003 08:38:27 -0700 Subject: [PATCH] Check whether a parameter declaration is a type before trying to parse it as a type. --- parse.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parse.c b/parse.c index 26703755..c582b8bb 100644 --- a/parse.c +++ b/parse.c @@ -886,6 +886,10 @@ static struct token *parameter_type_list(struct token *token, struct symbol *fn) break; } + if (!lookup_type(token)) { + warn(token->pos, "non-ANSI parameter list"); + break; + } token = parameter_declaration(token, &sym); /* Special case: (void) */ if (!*list && !sym->ident && sym->ctype.base_type == &void_ctype) -- 2.11.4.GIT