- Apparently, va_list is a reference type on x86_64 Linux systems, so

veprintf() needs to make a copy to pass to the second call to
  vfprintf(), since it will be modified by the first call.
- Removed three warnings when compiling with GCC 4.3.


SVN r1328 (trunk)
This commit is contained in:
Randy Heit 2008-12-24 18:39:25 +00:00
parent d6914c22ed
commit 0157077f3f
2 changed files with 14 additions and 3 deletions

11
error.c
View file

@ -411,9 +411,20 @@ static void eprintf(const char *fmt, ...)
static void veprintf(const char *fmt, va_list args)
{
#ifdef va_copy
va_list copy;
va_copy(copy, args);
#endif
vfprintf(stderr, fmt, args);
if(ErrorFile)
{
#ifdef va_copy
vfprintf(ErrorFile, fmt, copy);
#else
vfprintf(ErrorFile, fmt, args);
#endif
}
#ifdef va_copy
va_end(copy);
#endif
}

View file

@ -860,7 +860,7 @@ static void OuterFunction(void)
TK_TokenMustBe(TK_LBRACE, ERR_MISSING_LBRACE);
TK_NextToken();
do ; while(ProcessStatement(STMT_SCRIPT) == YES);
do {} while(ProcessStatement(STMT_SCRIPT) == YES);
if(pc_LastAppendedCommand != PCD_RETURNVOID &&
pc_LastAppendedCommand != PCD_RETURNVAL)
@ -1390,7 +1390,7 @@ static void LeadingCompoundStatement(statement_t owner)
{
StatementLevel += AdjustStmtLevel[owner];
TK_NextToken(); // Eat the TK_LBRACE
do ; while(ProcessStatement(owner) == YES);
do {} while(ProcessStatement(owner) == YES);
TK_TokenMustBe(TK_RBRACE, ERR_INVALID_STATEMENT);
TK_NextToken();
StatementLevel -= AdjustStmtLevel[owner];
@ -1447,7 +1447,7 @@ static void LeadingVarDeclare(void)
if(tk_Token == TK_LBRACKET)
{
ERR_Error(ERR_ARRAY_MAPVAR_ONLY, YES);
do ; while(TK_NextToken() != TK_COMMA && tk_Token != TK_SEMICOLON);
do {} while(TK_NextToken() != TK_COMMA && tk_Token != TK_SEMICOLON);
}
else if(tk_Token == TK_ASSIGN)
{