From 0157077f3f87dd0e23b17dbe5f935d43ec5a1586 Mon Sep 17 00:00:00 2001
From: Randy Heit <rheit@zdoom.fake>
Date: Wed, 24 Dec 2008 18:39:25 +0000
Subject: [PATCH] - 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)
---
 error.c | 11 +++++++++++
 parse.c |  6 +++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/error.c b/error.c
index 31197bf..29fe0d2 100644
--- a/error.c
+++ b/error.c
@@ -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
 }
diff --git a/parse.c b/parse.c
index c38a992..b78895a 100644
--- a/parse.c
+++ b/parse.c
@@ -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)
 		{