Date: Sun, 26 May 2002 18:38:37 +0100 From: "Richard Dawe" Sender: rich AT phekda DOT freeserve DOT co DOT uk To: djgpp-workers AT delorie DOT com X-Mailer: Emacs 21.2.50 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6 Subject: Some fixes for non-libc warnings Message-Id: Reply-To: djgpp-workers AT delorie DOT com Hello. Below is a diff to fix some warnings outside of libc. I haven't tested the diffs to the debuggers, other than the fact they start up and don't crash. I think that's sufficient, since they use the patched functions to display their disassembly output. OK to commit? Thanks, bye, Rich =] Index: ./src/debug/fsdb/expr.y =================================================================== RCS file: /cvs/djgpp/djgpp/src/debug/fsdb/expr.y,v retrieving revision 1.4 diff -p -u -3 -r1.4 expr.y --- ./src/debug/fsdb/expr.y 2001/10/13 11:37:53 1.4 +++ ./src/debug/fsdb/expr.y 2002/05/26 17:26:31 @@ -48,6 +48,7 @@ static char *error; main : expr { result = $1; } + ; expr : NUM { $$ = $1; } Index: ./src/debug/edebug/unassmbl.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/debug/edebug/unassmbl.c,v retrieving revision 1.3 diff -p -u -3 -r1.3 unassmbl.c --- ./src/debug/edebug/unassmbl.c 1997/10/28 19:35:18 1.3 +++ ./src/debug/edebug/unassmbl.c 2002/05/26 17:26:34 @@ -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 */ @@ -14,6 +15,7 @@ ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ +#include #include #include @@ -340,8 +342,12 @@ static int sib(void) /*------------------------------------------------------------------------*/ static void uprintf(const char *s, ...) { - const char **a = &s; - vsprintf(ubufp, s, a+1); + va_list args; + + va_start(args, s); + vsprintf(ubufp, s, args); + va_end(args); + while (*ubufp) ubufp++; } Index: ./src/debug/fsdb/unassmbl.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/debug/fsdb/unassmbl.c,v retrieving revision 1.4 diff -p -u -3 -r1.4 unassmbl.c --- ./src/debug/fsdb/unassmbl.c 2002/03/16 13:32:53 1.4 +++ ./src/debug/fsdb/unassmbl.c 2002/05/26 17:26:42 @@ -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 */ @@ -17,6 +18,7 @@ /* Modified by Morten Welinder, terra AT diku DOT dk, for use with full screen debugger. These changes are copyright 1994 by Morten Welinder. */ +#include #include #include #include @@ -354,8 +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); + va_end(args); + while (*ubufp) ubufp++; } Index: ./src/libemu/src/emu387.cc =================================================================== RCS file: /cvs/djgpp/djgpp/src/libemu/src/emu387.cc,v retrieving revision 1.11 diff -p -u -3 -r1.11 emu387.cc --- ./src/libemu/src/emu387.cc 2001/03/18 15:59:22 1.11 +++ ./src/libemu/src/emu387.cc 2002/05/26 17:26:51 @@ -1,8 +1,10 @@ +/* Copyright (C) 2002 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ +#include #include #include #include @@ -141,8 +143,13 @@ static inline int is_zero(reg a) #ifndef eprintf static void eprintf(const char *f, ...) { + va_list args; char buf[1000]; - vsprintf(buf, f, (&f)+1); + + va_start(args, f); + vsprintf(buf, f, args); + va_end(args); + _write(1, buf, strlen(buf)); } #endif