From: Joel E. Denny <jdenny@clemson.edu>
Date: Sun, 11 Oct 2009 20:15:39 +0000 (-0400)
Subject: portability: use va_start and va_end in the same function.
X-Git-Tag: v2.5_rc1~146
X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/a70596de9594b777f3fffb822f8f569ded772557

portability: use va_start and va_end in the same function.

* src/complain.c (error_message): Move va_end from here...
(ERROR_MESSAGE): ... to here.
(cherry picked from commit 786578e394700615f6a841614e1280bf6284ec8c)
---

diff --git a/ChangeLog b/ChangeLog
index 7c15b9fd..0a15c5a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-11  Joel E. Denny  <jdenny@clemson.edu>
+
+	portability: use va_start and va_end in the same function.
+	* src/complain.c (error_message): Move va_end from here...
+	(ERROR_MESSAGE): ... to here.
+
 2009-10-08  Joel E. Denny  <jdenny@clemson.edu>
 
 	* data/bison.m4: Update comments for rename to muscle-tab.h.
diff --git a/src/complain.c b/src/complain.c
index 7bb22de0..63dfc935 100644
--- a/src/complain.c
+++ b/src/complain.c
@@ -68,7 +68,6 @@ error_message (location *loc,
     fprintf (stderr, "%s: ", prefix);
 
   vfprintf (stderr, message, args);
-  va_end (args);
   putc ('\n', stderr);
   fflush (stderr);
 }
@@ -79,6 +78,7 @@ error_message (location *loc,
   va_list args;					\
   va_start (args, Message);			\
   error_message (Loc, Prefix, Message, args);	\
+  va_end (args);				\
 }