delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/28/06:12:13

Message-ID: <007d01c20630$26934de0$0102a8c0@acceleron>
From: "Andrew Cottrell" <acottrel AT ihug DOT com DOT au>
To: <djgpp-workers AT delorie DOT com>
Subject: GCC 3.1 & CVS LIC src\debug\fsdb\unassmbl.c patch (warning)
Date: Tue, 28 May 2002 20:11:48 +1000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Reply-To: djgpp-workers AT delorie DOT com

All,

Below is a patch that I've used in order to remove a warning when building
CVS LIBC with gcc 3.1. Any problems with this?

Andrew


--- src\debug\fsdb\orig\unassmbl.c 2002-04-17 07:14:18.000000000 +1000
+++ src\debug\fsdb\unassmbl.c 2002-05-28 19:47:00.000000000 +1000
@@ -1,3 +1,4 @@
+/* Copyright (C) 2002 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
@@ -20,6 +21,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/stat.h>
+#include <stdarg.h>

 #include "ed.h"
 #include "unassmbl.h"
@@ -354,9 +356,12 @@ sib(void)
 void
 uprintf(char *s, ...)
 {
-  char **a = &s;
-  vsprintf(ubufp, s, a+1);
+  va_list args;
+
+  va_start(args, s);
+  vsprintf(ubufp, s, args);
   while (*ubufp) ubufp++;
+  va_end(args);
 }

 void




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019