Message-ID: <007501c20630$0cd18610$0102a8c0@acceleron> From: "Andrew Cottrell" To: Subject: GCC 3.1 & CVS LIC src\debug\fsdb\screen.c patch (warning) Date: Tue, 28 May 2002 19:59:04 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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\screen.c 1998-09-08 03:58:04.000000000 +1000 +++ src\debug\fsdb\screen.c 2002-05-28 19:47:04.000000000 +1000 @@ -1,3 +1,4 @@ +/* Copyright (C) 2002 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include @@ -10,6 +11,7 @@ #include #include #include +#include #include "ed.h" #include "screen.h" void *xmalloc (size_t); @@ -210,11 +212,15 @@ mysleep (int secs) void message (CL_TYPE class, char *fmt, ...) { + va_list args; char *save, *buf = alloca (cols); unsigned char saveattr = screen_attr; int len, y = rows / 2; - vsprintf (buf, fmt, (&fmt) + 1); + va_start(args, fmt); + vsprintf (buf, fmt, args); + va_end(args); + len = strlen (buf); save = debug_screen_save; debug_screen_save = get_screen ();