From 8902803f752535d841d0f94202a9a59334e27182 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Fri, 28 Mar 1997 20:48:12 +0000 Subject: [PATCH] Fix faulty assumption that va_list is a pointer type --- gdb/remote-sim.c | 16 ++++++++-------- include/callback.h | 13 +++++++++++-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 339b39cc1a2..64dbb5dcf98 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -55,9 +55,9 @@ static void gdb_os_flush_stderr PARAMS ((host_callback *)); /* printf_filtered is depreciated */ static void gdb_os_printf_filtered PARAMS ((host_callback *, const char *, ...)); -static void gdb_os_vprintf_filtered PARAMS ((host_callback *, const char *, void *)); +static void gdb_os_vprintf_filtered PARAMS ((host_callback *, const char *, va_list)); -static void gdb_os_evprintf_filtered PARAMS ((host_callback *, const char *, void *)); +static void gdb_os_evprintf_filtered PARAMS ((host_callback *, const char *, va_list)); static void gdb_os_error PARAMS ((host_callback *, const char *, ...)); @@ -268,15 +268,15 @@ gdb_os_printf_filtered (p, va_alist) /* VARARGS */ static void #ifdef ANSI_PROTOTYPES -gdb_os_vprintf_filtered (host_callback *p, const char *format, void *ap) +gdb_os_vprintf_filtered (host_callback *p, const char *format, va_list ap) #else gdb_os_vprintf_filtered (p, format, ap) host_callback *p; char *format; - void *ap; + va_list ap; #endif { - vfprintf_filtered (gdb_stdout, format, (va_list)ap); + vfprintf_filtered (gdb_stdout, format, ap); } /* GDB version of error evprintf_filtered. */ @@ -284,15 +284,15 @@ gdb_os_vprintf_filtered (p, format, ap) /* VARARGS */ static void #ifdef ANSI_PROTOTYPES -gdb_os_evprintf_filtered (host_callback *p, const char *format, void *ap) +gdb_os_evprintf_filtered (host_callback *p, const char *format, va_list ap) #else gdb_os_evprintf_filtered (p, format, ap) host_callback *p; char *format; - void *ap; + va_list ap; #endif { - vfprintf_filtered (gdb_stderr, format, (va_list)ap); + vfprintf_filtered (gdb_stderr, format, ap); } /* GDB version of error callback. */ diff --git a/include/callback.h b/include/callback.h index 944a1b787fd..b2a7fe247d9 100644 --- a/include/callback.h +++ b/include/callback.h @@ -20,6 +20,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef CALLBACK_H #define CALLBACK_H +#ifndef va_start +#include +#ifdef ANSI_PROTOTYPES +#include +#else +#include +#endif +#endif + typedef struct host_callback_struct host_callback; #define MAX_CALLBACK_FDS 10 @@ -53,10 +62,10 @@ struct host_callback_struct /* Talk to the user on a console. The `void *' is actually `va_list *'. */ - void (*vprintf_filtered) PARAMS ((host_callback *, const char *, void *)); + void (*vprintf_filtered) PARAMS ((host_callback *, const char *, va_list)); /* Same as vprintf_filtered but to stderr. */ - void (*evprintf_filtered) PARAMS ((host_callback *, const char *, void *)); + void (*evprintf_filtered) PARAMS ((host_callback *, const char *, va_list)); /* Print an error message and "exit". In the case of gdb "exiting" means doing a longjmp back to the main -- 2.30.2