mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Fixed Issue #1265 according to C89/C99 standards.
This commit is contained in:
parent
c9ac515286
commit
bfc7a51a44
@ -462,7 +462,7 @@ Type* GetImplicitFuncType (void)
|
|||||||
Type* T = TypeAlloc (3); /* func/returns int/terminator */
|
Type* T = TypeAlloc (3); /* func/returns int/terminator */
|
||||||
|
|
||||||
/* Prepare the function descriptor */
|
/* Prepare the function descriptor */
|
||||||
F->Flags = FD_EMPTY | FD_VARIADIC;
|
F->Flags = FD_EMPTY;
|
||||||
F->SymTab = &EmptySymTab;
|
F->SymTab = &EmptySymTab;
|
||||||
F->TagTab = &EmptySymTab;
|
F->TagTab = &EmptySymTab;
|
||||||
|
|
||||||
|
@ -1171,16 +1171,16 @@ static void Primary (ExprDesc* E)
|
|||||||
|
|
||||||
/* IDENT is either an auto-declared function or an undefined variable. */
|
/* IDENT is either an auto-declared function or an undefined variable. */
|
||||||
if (CurTok.Tok == TOK_LPAREN) {
|
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
|
** generate an error and otherwise a warning. Declare a
|
||||||
** function returning int. For that purpose, prepare a
|
** function returning int. For that purpose, prepare a
|
||||||
** function signature for a function having an empty param
|
** function signature for a function having an empty param
|
||||||
** list and returning int.
|
** list and returning int.
|
||||||
*/
|
*/
|
||||||
if (IS_Get (&Standard) >= STD_C99) {
|
if (IS_Get (&Standard) >= STD_C99) {
|
||||||
Error ("Call to undefined function '%s'", Ident);
|
Error ("Call to undeclared function '%s'", Ident);
|
||||||
} else {
|
} 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);
|
Sym = AddGlobalSym (Ident, GetImplicitFuncType(), SC_EXTERN | SC_REF | SC_FUNC);
|
||||||
E->Type = Sym->Type;
|
E->Type = Sym->Type;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user