Fixed a bug. Function declarations where the type of the first parameter is
a typedef and the name of the parameter is omitted where parse as old style (K&R) function declarations leading to errors. git-svn-id: svn://svn.cc65.org/cc65/trunk@688 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -741,8 +741,14 @@ static FuncDesc* ParseFuncDecl (void)
|
|||||||
NextToken ();
|
NextToken ();
|
||||||
F->Flags |= FD_VOID_PARAM;
|
F->Flags |= FD_VOID_PARAM;
|
||||||
} else if (curtok == TOK_IDENT && (nxttok == TOK_COMMA || nxttok == TOK_RPAREN)) {
|
} else if (curtok == TOK_IDENT && (nxttok == TOK_COMMA || nxttok == TOK_RPAREN)) {
|
||||||
/* Old style (K&R) function. Assume variable param list. */
|
/* If the identifier is a typedef, we have a new style parameter list,
|
||||||
F->Flags |= (FD_OLDSTYLE | FD_VARIADIC);
|
* if it's some other identifier, it's an old style parameter list.
|
||||||
|
*/
|
||||||
|
Sym = FindSym (CurTok.Ident);
|
||||||
|
if (Sym == 0 || !IsTypeDef (Sym)) {
|
||||||
|
/* Old style (K&R) function. Assume variable param list. */
|
||||||
|
F->Flags |= (FD_OLDSTYLE | FD_VARIADIC);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse params */
|
/* Parse params */
|
||||||
|
|||||||
Reference in New Issue
Block a user