From 9222de75dafd9610649628ff8fdff13ccdc1bef9 Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 26 Dec 2002 16:14:57 +0000 Subject: [PATCH] Check for implicit int return in all cases git-svn-id: svn://svn.cc65.org/cc65/trunk@1851 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/declare.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/cc65/declare.c b/src/cc65/declare.c index 22d8c310e..a11dc0a5f 100644 --- a/src/cc65/declare.c +++ b/src/cc65/declare.c @@ -745,23 +745,23 @@ static FuncDesc* ParseFuncDecl (const DeclSpec* Spec) NextToken (); F->Flags |= FD_VOID_PARAM; } else if (CurTok.Tok == TOK_IDENT && - (NextTok.Tok == TOK_COMMA || NextTok.Tok == TOK_RPAREN)) { - /* If the identifier is a typedef, we have a new style parameter list, - * if it's some other identifier, it's an old style parameter list. - */ - Sym = FindSym (CurTok.Ident); - if (Sym == 0 || !SymIsTypeDef (Sym)) { - /* Old style (K&R) function. Assume variable param list. */ - F->Flags |= (FD_OLDSTYLE | FD_VARIADIC); - - /* Check for an implicit int return in the K&R function */ - if ((Spec->Flags & DS_DEF_TYPE) != 0 && - Spec->Type[0] == T_INT && - Spec->Type[1] == T_END) { - /* Function has an implicit int return */ - F->Flags |= FD_OLDSTYLE_INTRET; - } - } + (NextTok.Tok == TOK_COMMA || NextTok.Tok == TOK_RPAREN)) { + /* If the identifier is a typedef, we have a new style parameter list, + * if it's some other identifier, it's an old style parameter list. + */ + Sym = FindSym (CurTok.Ident); + if (Sym == 0 || !SymIsTypeDef (Sym)) { + /* Old style (K&R) function. Assume variable param list. */ + F->Flags |= (FD_OLDSTYLE | FD_VARIADIC); + } + } + + /* Check for an implicit int return in the function */ + if ((Spec->Flags & DS_DEF_TYPE) != 0 && + Spec->Type[0] == T_INT && + Spec->Type[1] == T_END) { + /* Function has an implicit int return */ + F->Flags |= FD_OLDSTYLE_INTRET; } /* Parse params */ -- 2.39.5