From 27490ed0321fd439eb9ee061a0cff62fbb569821 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Mon, 15 Sep 2008 14:12:00 +0000 Subject: [PATCH] In strict mode do not generate an implicit function declaration, but an error declaration. This prevents stray warnings about incompatible return types later on. [r21973] --- parser.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/parser.c b/parser.c index 1502d2e..09c521d 100644 --- a/parser.c +++ b/parser.c @@ -6050,11 +6050,9 @@ static expression_t *parse_reference(void) declaration_t *declaration = get_declaration(symbol, NAMESPACE_NORMAL); if (declaration == NULL) { - if (look_ahead(1)->type == '(') { + if (!strict_mode && look_ahead(1)->type == '(') { /* an implicitly declared function */ - if (strict_mode) { - errorf(HERE, "unknown symbol '%Y' found.", symbol); - } else if (warning.implicit_function_declaration) { + if (warning.implicit_function_declaration) { warningf(HERE, "implicit declaration of function '%Y'", symbol); } -- 2.20.1