From 85c613aaa7092f8dfc8ce0c475e0ef210685bc16 Mon Sep 17 00:00:00 2001 From: "J.T. Conklin" Date: Thu, 18 May 1995 23:45:31 +0000 Subject: [PATCH] * utils.c (fprintf_filtered, fprintf_unfiltered, fprintfi_filtered, printf_filtered, printf_unfiltered, printfi_filtered, query, warning, error, fatal, fatal_dump_core): Use stdarg.h macros when compiling with an ANSI compiler. * complain.c (complain): Likewise. * language.c (type_error, range_error): Likewise. * monitor.c (monitor_printf, monitor_printf_noecho): Likewise. * remote-array.c (printf_monitor, debuglogs): Likewise. * remote-mips.c (mips_error): Likewise. * remote-os9k.c (printf_monitor): Likewise. * remote-st.c (printf_stdebug): Likewise. * gdbtk.c (gdbtk_query): Likewise. * defs.h, complain.h, language.h, monitor.h: Add prototypes to match above changes. * printcmd.c: Remove uneeded #include . * remote-e7000.c: Likewise. * f-typeprint.c (f_type_print_base): Fix typo found by above changes. --- gdb/ChangeLog | 26 ++++++++++ gdb/complaints.c | 13 +++++ gdb/complaints.h | 2 +- gdb/defs.h | 20 ++++---- gdb/f-typeprint.c | 2 +- gdb/gdbtk.c | 22 ++++++--- gdb/language.c | 28 +++++++++-- gdb/language.h | 4 +- gdb/monitor.c | 26 ++++++++-- gdb/monitor.h | 3 +- gdb/printcmd.c | 8 ++-- gdb/remote-array.c | 36 ++++++++++---- gdb/remote-mips.c | 17 ++++++- gdb/remote-os9k.c | 16 ++++++- gdb/remote-st.c | 17 ++++++- gdb/utils.c | 117 ++++++++++++++++++++++++++++++++++++++------- 16 files changed, 292 insertions(+), 65 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a9ec6ce78d9..b9e336045b8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,29 @@ +Thu May 18 15:58:46 1995 J.T. Conklin + + * utils.c (fprintf_filtered, fprintf_unfiltered, fprintfi_filtered, + printf_filtered, printf_unfiltered, printfi_filtered, query, warning, + error, fatal, fatal_dump_core): Use stdarg.h macros when compiling + with an ANSI compiler. + * complain.c (complain): Likewise. + * language.c (type_error, range_error): Likewise. + * monitor.c (monitor_printf, monitor_printf_noecho): Likewise. + * remote-array.c (printf_monitor, debuglogs): Likewise. + * remote-mips.c (mips_error): Likewise. + * remote-os9k.c (printf_monitor): Likewise. + * remote-st.c (printf_stdebug): Likewise. +start-sanitize-gdbtk + * gdbtk.c (gdbtk_query): Likewise. +end-sanitize-gdbtk + + * defs.h, complain.h, language.h, monitor.h: Add prototypes to + match above changes. + + * printcmd.c: Remove uneeded #include . + * remote-e7000.c: Likewise. + + * f-typeprint.c (f_type_print_base): Fix typo found by above + changes. + Wed May 17 11:21:32 1995 Jim Kingdon * Makefile.in (xcoffread.o): Depend on partial-stab.h. diff --git a/gdb/complaints.c b/gdb/complaints.c index e441db4218d..b5511437155 100644 --- a/gdb/complaints.c +++ b/gdb/complaints.c @@ -20,7 +20,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "defs.h" #include "complaints.h" #include "gdbcmd.h" +#ifdef __STDC__ +#include +#else #include +#endif /* Structure to manage complaints about symbol file contents. */ @@ -59,14 +63,23 @@ extern int info_verbose; /* VARARGS */ void +#ifdef __STDC__ +complain (struct complaint *complaint, ...) +#else complain (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, complaint); +#else struct complaint *complaint; va_start (args); complaint = va_arg (args, struct complaint *); +#endif + complaint -> counter++; if (complaint -> next == NULL) { diff --git a/gdb/complaints.h b/gdb/complaints.h index f7ff5a56814..881e484bb26 100644 --- a/gdb/complaints.h +++ b/gdb/complaints.h @@ -40,7 +40,7 @@ extern struct complaint complaint_root[1]; /* Functions that handle complaints. (in complaints.c) */ extern void -complain (); +complain PARAMS ((struct complaint *, ...)); extern void clear_complaints PARAMS ((int, int)); diff --git a/gdb/defs.h b/gdb/defs.h index 25c6fbc71f5..2ed546f44ee 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -187,7 +187,7 @@ extern void null_cleanup PARAMS ((char **)); extern int myread PARAMS ((int, char *, int)); -extern int query (); +extern int query PARAMS((char *, ...)); /* Annotation stuff. */ @@ -223,21 +223,21 @@ extern void vprintf_filtered (); extern void vfprintf_filtered (); -extern void fprintf_filtered (); +extern void fprintf_filtered PARAMS ((FILE *, char *, ...)); -extern void fprintfi_filtered (); +extern void fprintfi_filtered PARAMS ((int, FILE *, char *, ...)); -extern void printf_filtered (); +extern void printf_filtered PARAMS ((char *, ...)); -extern void printfi_filtered (); +extern void printfi_filtered PARAMS ((int, char *, ...)); extern void vprintf_unfiltered (); extern void vfprintf_unfiltered (); -extern void fprintf_unfiltered (); +extern void fprintf_unfiltered PARAMS ((FILE *, char *, ...)); -extern void printf_unfiltered (); +extern void printf_unfiltered PARAMS ((char *, ...)); extern void print_spaces PARAMS ((int, GDB_FILE *)); @@ -549,11 +549,11 @@ extern char *quit_pre_print; extern char *warning_pre_print; -extern NORETURN void error () ATTR_NORETURN; +extern NORETURN void error PARAMS((char *, ...)) ATTR_NORETURN; extern void error_begin PARAMS ((void)); -extern NORETURN void fatal () ATTR_NORETURN; +extern NORETURN void fatal PARAMS((char *, ...)) ATTR_NORETURN; extern NORETURN void nomem PARAMS ((long)) ATTR_NORETURN; @@ -579,7 +579,7 @@ catch_errors PARAMS ((int (*) (char *), void *, char *, return_mask)); extern void warning_begin PARAMS ((void)); -extern void warning (); +extern void warning PARAMS ((char *, ...)); /* Global functions from other, non-gdb GNU thingies. Libiberty thingies are no longer declared here. We include libiberty.h diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c index 699c61dbbf4..8775b379adc 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -425,7 +425,7 @@ f_type_print_base (type, stream, show, level) /* Strings may have dynamic upperbounds (lengths) like arrays. */ if (TYPE_ARRAY_UPPER_BOUND_TYPE (type) == BOUND_CANNOT_BE_DETERMINED) - fprintf_filtered ("character*(*)"); + fprintf_filtered (stream, "character*(*)"); else { retcode = f77_get_dynamic_upperbound (type, &upper_bound); diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c index 802e0b916a9..848502503cb 100644 --- a/gdb/gdbtk.c +++ b/gdb/gdbtk.c @@ -29,7 +29,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "target.h" #include #include +#ifdef __STDC__ +#include +#else #include +#endif #include #include #include @@ -121,15 +125,13 @@ gdbtk_fputs (ptr, stream) } static int -gdbtk_query (args) +gdbtk_query (query, args) + char *query; va_list args; { - char *query; char buf[200]; long val; - query = va_arg (args, char *); - vsprintf (buf, query, args); Tcl_VarEval (interp, "gdbtk_tcl_query ", "{", buf, "}", NULL); @@ -138,18 +140,26 @@ gdbtk_query (args) } static void +#ifdef __STDC__ +dsprintf_append_element (Tcl_DString *dsp, char *format, ...) +#else dsprintf_append_element (va_alist) va_dcl +#endif { va_list args; + char buf[1024]; + +#ifdef __STDC__ + va_start (args, format); +#else Tcl_DString *dsp; char *format; - char buf[1024]; va_start (args); - dsp = va_arg (args, Tcl_DString *); format = va_arg (args, char *); +#endif vsprintf (buf, format, args); diff --git a/gdb/language.c b/gdb/language.c index a2dc7ba1cc5..3c27b7d9180 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -29,7 +29,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "defs.h" #include +#ifdef __STDC__ +#include +#else #include +#endif #include "symtab.h" #include "gdbtypes.h" @@ -978,19 +982,27 @@ op_error (fmt,op,fatal) by the value of warning_pre_print and we do not return to the top level. */ void +#ifdef __STDC__ +type_error (char *string, ...) +#else type_error (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, string); +#else char *string; + va_start (args); + string = va_arg (args, char *); +#endif if (type_check == type_check_warn) fprintf_filtered (gdb_stderr, warning_pre_print); else error_begin (); - va_start (args); - string = va_arg (args, char *); vfprintf_filtered (gdb_stderr, string, args); fprintf_filtered (gdb_stderr, "\n"); va_end (args); @@ -999,19 +1011,27 @@ type_error (va_alist) } void +#ifdef __STDC__ +range_error (char *string, ...) +#else range_error (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, string); +#else char *string; + va_start (args); + string = va_arg (args, char *); +#endif if (range_check == range_check_warn) fprintf_filtered (gdb_stderr, warning_pre_print); else error_begin (); - va_start (args); - string = va_arg (args, char *); vfprintf_filtered (gdb_stderr, string, args); fprintf_filtered (gdb_stderr, "\n"); va_end (args); diff --git a/gdb/language.h b/gdb/language.h index 02fccec1ee0..9e77acc65ea 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -395,10 +395,10 @@ op_error PARAMS ((char *fmt, enum exp_opcode, int)); op_error((f),(o),range_check==range_check_on ? 1 : 0) extern void -type_error (); +type_error PARAMS ((char *, ...)); void -range_error (); +range_error PARAMS ((char *, ...)); /* Data: Does this value represent "truth" to the current language? */ diff --git a/gdb/monitor.c b/gdb/monitor.c index 5693d4c69fe..ba54719548c 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -32,7 +32,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "gdbcore.h" #include "target.h" #include "wait.h" +#ifdef __STDC__ +#include +#else #include +#endif #include #include #include @@ -111,17 +115,24 @@ static int dump_reg_flag; /* Non-zero means do a dump_registers cmd when Works just like printf. */ void +#ifdef __STDC__ +monitor_printf_noecho (char *pattern, ...) +#else monitor_printf_noecho (va_alist) va_dcl +#endif { va_list args; - char *pattern; char sndbuf[2000]; int len; +#if __STDC__ + va_start (args, pattern); +#else + char *pattern; va_start (args); - pattern = va_arg (args, char *); +#endif vsprintf (sndbuf, pattern, args); @@ -141,18 +152,25 @@ monitor_printf_noecho (va_alist) printf. */ void +#ifdef __STDC__ +monitor_printf (char *pattern, ...) +#else monitor_printf (va_alist) va_dcl +#endif { va_list args; - char *pattern; char sndbuf[2000]; int len; int i, c; +#ifdef __STDC__ + va_start (args, pattern); +#else + char *pattern; va_start (args); - pattern = va_arg (args, char *); +#endif vsprintf (sndbuf, pattern, args); diff --git a/gdb/monitor.h b/gdb/monitor.h index 64e78707fe2..dde19aa0c27 100644 --- a/gdb/monitor.h +++ b/gdb/monitor.h @@ -172,5 +172,6 @@ extern void monitor_open PARAMS ((char *args, struct monitor_ops *ops, int from_ extern char *monitor_supply_register PARAMS ((int regno, char *valstr)); extern int monitor_expect PARAMS ((char *prompt, char *buf, int buflen)); extern int monitor_expect_prompt PARAMS ((char *buf, int buflen)); -extern void monitor_printf (); +extern void monitor_printf PARAMS ((char *, ...)); +extern void monitor_printf_noecho PARAMS ((char *, ...)); extern void init_monitor_ops PARAMS ((struct target_ops *)); diff --git a/gdb/printcmd.c b/gdb/printcmd.c index bde7709daca..e2718065e93 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -20,7 +20,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "defs.h" #include -#include #include "frame.h" #include "symtab.h" #include "gdbtypes.h" @@ -586,9 +585,8 @@ print_address_numeric (addr, use_local, stream) GDB_FILE *stream; { /* This assumes a CORE_ADDR can fit in a LONGEST. Probably a safe - assumption. We pass use_local but I'm not completely sure whether - that is correct. When (if ever) should we *not* use_local? */ - print_longest (stream, 'x', 1, (unsigned LONGEST) addr); + assumption. */ + print_longest (stream, 'x', use_local, (unsigned LONGEST) addr); } /* Print address ADDR symbolically on STREAM. @@ -927,7 +925,7 @@ address_info (exp, from_tty) return; } - msymbol = lookup_minimal_symbol (exp, (struct objfile *) NULL); + msymbol = lookup_minimal_symbol (exp, NULL, NULL); if (msymbol != NULL) { diff --git a/gdb/remote-array.c b/gdb/remote-array.c index 7f381cd0704..dc1c4640465 100644 --- a/gdb/remote-array.c +++ b/gdb/remote-array.c @@ -28,7 +28,11 @@ #include "gdbcore.h" #include "target.h" #include "wait.h" +#ifdef __STDC__ +#include +#else #include +#endif #include #include #include @@ -62,7 +66,7 @@ static char *hex2mem(); } \ while (0) -static void debuglogs(); +static void debuglogs PARAMS((int, char *, ...)); static void array_open(); static void array_close(); static void array_detach(); @@ -169,17 +173,24 @@ Specify the serial device it is connected to (e.g. /dev/ttya).", * printf_monitor -- send data to monitor. Works just like printf. */ static void +#ifdef __STDC__ +printf_monitor(char *pattern, ...) +#else printf_monitor(va_alist) va_dcl +#endif { va_list args; - char *pattern; char buf[PBUFSIZ]; int i; +#ifdef __STDC__ + va_start(args, pattern); +#else + char *pattern; va_start(args); - pattern = va_arg(args, char *); +#endif vsprintf(buf, pattern, args); @@ -213,25 +224,34 @@ write_monitor(data, len) * to be formatted and printed. A CR is added after each string is printed. */ static void +#ifdef __STDC__ +debuglogs(int level, char *pattern, ...) +#else debuglogs(va_alist) va_dcl +#endif { va_list args; - char *pattern, *p; + char *p; unsigned char buf[PBUFSIZ]; char newbuf[PBUFSIZ]; - int level, i; + int i; +#ifdef __STDC__ + va_start(args, pattern); +#else + char *pattern; + int level; va_start(args); - level = va_arg(args, int); /* get the debug level */ + pattern = va_arg(args, char *); /* get the printf style pattern */ +#endif + if ((level <0) || (level > 100)) { error ("Bad argument passed to debuglogs(), needs debug level"); return; } - pattern = va_arg(args, char *); /* get the printf style pattern */ - vsprintf(buf, pattern, args); /* format the string */ /* convert some characters so it'll look right in the log */ diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 2519f537130..568694c6037 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -31,7 +31,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "remote-utils.h" #include +#ifdef __STDC__ +#include +#else #include +#endif extern char *mips_read_processor_type PARAMS ((void)); @@ -271,19 +275,28 @@ static serial_t mips_desc; inconsistent state. */ static NORETURN void +#ifdef __STDC__ +mips_error (char *string, ...) +#else mips_error (va_alist) va_dcl +#endif { va_list args; - char *string; +#ifdef __STDC__ + va_start (args, string); +#else + char *string; va_start (args); + string = va_arg (args, char *); +#endif + target_terminal_ours (); wrap_here(""); /* Force out any buffered output */ gdb_flush (gdb_stdout); if (error_pre_print) fprintf_filtered (gdb_stderr, error_pre_print); - string = va_arg (args, char *); vfprintf_filtered (gdb_stderr, string, args); fprintf_filtered (gdb_stderr, "\n"); va_end (args); diff --git a/gdb/remote-os9k.c b/gdb/remote-os9k.c index a4f4e86a6c8..2dc526c5d5b 100644 --- a/gdb/remote-os9k.c +++ b/gdb/remote-os9k.c @@ -37,7 +37,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "gdbcore.h" #include "target.h" #include "wait.h" +#ifdef __STDC__ +#include +#else #include +#endif #include #include #include @@ -86,19 +90,27 @@ static char readbuf[16]; /* Send data to monitor. Works just like printf. */ static void +#ifdef __STDC__ +printf_monitor(char *pattern, ...) +#else printf_monitor(va_alist) va_dcl +#endif { va_list args; - char *pattern; char buf[200]; int i; +#ifdef __STDC__ + va_start (args, pattern); +#else + char *pattern; va_start(args); - pattern = va_arg(args, char *); +#endif vsprintf(buf, pattern, args); + va_end(args); if (SERIAL_WRITE(monitor_desc, buf, strlen(buf))) fprintf(stderr, "SERIAL_WRITE failed: %s\n", safe_strerror(errno)); diff --git a/gdb/remote-st.c b/gdb/remote-st.c index 8bec2f5dc0a..b74ba131885 100644 --- a/gdb/remote-st.c +++ b/gdb/remote-st.c @@ -38,7 +38,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "gdbcore.h" #include "target.h" #include "wait.h" +#ifdef __STDC__ +#include +#else #include +#endif #include #include #include @@ -66,18 +70,27 @@ static serial_t st2000_desc; /* Send data to stdebug. Works just like printf. */ static void +#ifdef __STDC__ +printf_stdebug(char *pattern, ...) +#else printf_stdebug(va_alist) va_dcl +#endif { va_list args; - char *pattern; char buf[200]; +#ifdef __STDC__ + va_start(args, pattern); +#else + char *pattern; va_start(args); - pattern = va_arg(args, char *); +#endif vsprintf(buf, pattern, args); + va_end(args); + if (SERIAL_WRITE(st2000_desc, buf, strlen(buf))) fprintf(stderr, "SERIAL_WRITE failed: %s\n", safe_strerror(errno)); } diff --git a/gdb/utils.c b/gdb/utils.c index dd3c746d77e..c11e15fc52e 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -23,7 +23,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #endif +#ifdef __STDC__ +#include +#else #include +#endif #include #include @@ -53,7 +57,7 @@ malloc_botch PARAMS ((void)); #endif /* NO_MMALLOC, etc */ static void -fatal_dump_core (); /* Can't prototype with usage... */ +fatal_dump_core PARAMS((char *, ...)); static void prompt_for_continue PARAMS ((void)); @@ -250,15 +254,23 @@ warning_begin () /* VARARGS */ void +#ifdef __STDC__ +warning (char *string, ...) +#else warning (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, string); +#else char *string; va_start (args); - warning_begin (); string = va_arg (args, char *); +#endif + warning_begin (); vfprintf_unfiltered (gdb_stderr, string, args); fprintf_unfiltered (gdb_stderr, "\n"); va_end (args); @@ -290,19 +302,23 @@ error_begin () /* VARARGS */ NORETURN void +#ifdef __STDC__ +error (char *string, ...) +#else error (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, string); +#else char *string; va_start (args); - - if (error_hook) - error_hook (args); /* Never returns */ - - error_begin (); string = va_arg (args, char *); +#endif + error_begin (); vfprintf_filtered (gdb_stderr, string, args); fprintf_filtered (gdb_stderr, "\n"); va_end (args); @@ -318,14 +334,22 @@ error (va_alist) /* VARARGS */ NORETURN void +#ifdef __STDC__ +fatal (char *string, ...) +#else fatal (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, string); +#else char *string; va_start (args); string = va_arg (args, char *); +#endif fprintf_unfiltered (gdb_stderr, "\ngdb: "); vfprintf_unfiltered (gdb_stderr, string, args); fprintf_unfiltered (gdb_stderr, "\n"); @@ -338,14 +362,22 @@ fatal (va_alist) /* VARARGS */ static void +#ifdef __STDC__ +fatal_dump_core (char *string, ...) +#else fatal_dump_core (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, string); +#else char *string; va_start (args); string = va_arg (args, char *); +#endif /* "internal error" is always correct, since GDB should never dump core, no matter what the input. */ fprintf_unfiltered (gdb_stderr, "\ngdb internal error: "); @@ -843,19 +875,29 @@ gdb_print_address (addr, stream) /* VARARGS */ int +#ifdef __STDC__ +query (char *ctlstr, ...) +#else query (va_alist) va_dcl +#endif { va_list args; - char *ctlstr; register int answer; register int ans2; int retval; +#ifdef __STDC__ + va_start (args, ctlstr); +#else + char *ctlstr; + va_start (args); + ctlstr = va_arg (args, char *); +#endif + if (query_hook) { - va_start (args); - return query_hook (args); + return query_hook (ctlstr, args); } /* Automatically answer "yes" if input is not from a terminal. */ @@ -875,10 +917,7 @@ query (va_alist) if (annotation_level > 1) printf_filtered ("\n\032\032pre-query\n"); - va_start (args); - ctlstr = va_arg (args, char *); vfprintf_filtered (gdb_stdout, ctlstr, args); - va_end (args); printf_filtered ("(y or n) "); if (annotation_level > 1) @@ -1500,34 +1539,48 @@ vprintf_unfiltered (format, args) /* VARARGS */ void +#ifdef __STDC__ +fprintf_filtered (FILE *stream, char *format, ...) +#else fprintf_filtered (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, format); +#else FILE *stream; char *format; va_start (args); stream = va_arg (args, FILE *); format = va_arg (args, char *); - +#endif vfprintf_filtered (stream, format, args); va_end (args); } /* VARARGS */ void +#ifdef __STDC__ +fprintf_unfiltered (FILE *stream, char *format, ...) +#else fprintf_unfiltered (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, format); +#else FILE *stream; char *format; va_start (args); stream = va_arg (args, FILE *); format = va_arg (args, char *); - +#endif vfprintf_unfiltered (stream, format, args); va_end (args); } @@ -1537,10 +1590,17 @@ fprintf_unfiltered (va_alist) /* VARARGS */ void +#ifdef __STDC__ +fprintfi_filtered (int spaces, FILE *stream, char *format, ...) +#else fprintfi_filtered (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, format); +#else int spaces; FILE *stream; char *format; @@ -1549,6 +1609,7 @@ fprintfi_filtered (va_alist) spaces = va_arg (args, int); stream = va_arg (args, FILE *); format = va_arg (args, char *); +#endif print_spaces_filtered (spaces, stream); vfprintf_filtered (stream, format, args); @@ -1558,15 +1619,22 @@ fprintfi_filtered (va_alist) /* VARARGS */ void +#ifdef __STDC__ +printf_filtered (char *format, ...) +#else printf_filtered (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, format); +#else char *format; va_start (args); format = va_arg (args, char *); - +#endif vfprintf_filtered (gdb_stdout, format, args); va_end (args); } @@ -1574,15 +1642,22 @@ printf_filtered (va_alist) /* VARARGS */ void +#ifdef __STDC__ +printf_unfiltered (char *format, ...) +#else printf_unfiltered (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, format); +#else char *format; va_start (args); format = va_arg (args, char *); - +#endif vfprintf_unfiltered (gdb_stdout, format, args); va_end (args); } @@ -1592,16 +1667,24 @@ printf_unfiltered (va_alist) /* VARARGS */ void +#ifdef __STDC__ +printfi_filtered (int spaces, char *format, ...) +#else printfi_filtered (va_alist) va_dcl +#endif { va_list args; +#ifdef __STDC__ + va_start (args, format); +#else int spaces; char *format; va_start (args); spaces = va_arg (args, int); format = va_arg (args, char *); +#endif print_spaces_filtered (spaces, gdb_stdout); vfprintf_filtered (gdb_stdout, format, args); va_end (args); -- 2.30.2