From bfc7a51a44641760dfcf77a7e3407ac52ad3f3a9 Mon Sep 17 00:00:00 2001 From: acqn Date: Sat, 10 Oct 2020 19:54:18 +0800 Subject: [PATCH] Fixed Issue #1265 according to C89/C99 standards. --- src/cc65/datatype.c | 2 +- src/cc65/expr.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cc65/datatype.c b/src/cc65/datatype.c index 413007a85..d78bfe116 100644 --- a/src/cc65/datatype.c +++ b/src/cc65/datatype.c @@ -462,7 +462,7 @@ Type* GetImplicitFuncType (void) Type* T = TypeAlloc (3); /* func/returns int/terminator */ /* Prepare the function descriptor */ - F->Flags = FD_EMPTY | FD_VARIADIC; + F->Flags = FD_EMPTY; F->SymTab = &EmptySymTab; F->TagTab = &EmptySymTab; diff --git a/src/cc65/expr.c b/src/cc65/expr.c index 0cf650d3b..751014af3 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -1171,16 +1171,16 @@ static void Primary (ExprDesc* E) /* IDENT is either an auto-declared function or an undefined variable. */ if (CurTok.Tok == TOK_LPAREN) { - /* C99 doesn't allow calls to undefined functions, so + /* C99 doesn't allow calls to undeclared functions, so ** generate an error and otherwise a warning. Declare a ** function returning int. For that purpose, prepare a ** function signature for a function having an empty param ** list and returning int. */ if (IS_Get (&Standard) >= STD_C99) { - Error ("Call to undefined function '%s'", Ident); + Error ("Call to undeclared function '%s'", Ident); } else { - Warning ("Call to undefined function '%s'", Ident); + Warning ("Call to undeclared function '%s'", Ident); } Sym = AddGlobalSym (Ident, GetImplicitFuncType(), SC_EXTERN | SC_REF | SC_FUNC); E->Type = Sym->Type;