1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 04:30:10 +00:00

Fixed Issue #1265 according to C89/C99 standards.

This commit is contained in:
acqn 2020-10-10 19:54:18 +08:00 committed by Oliver Schmidt
parent c9ac515286
commit bfc7a51a44
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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;