]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* utils.c (fprintf_filtered, fprintf_unfiltered, fprintfi_filtered,
authorJ.T. Conklin <jtc@acorntoolworks.com>
Thu, 18 May 1995 23:45:31 +0000 (23:45 +0000)
committerJ.T. Conklin <jtc@acorntoolworks.com>
Thu, 18 May 1995 23:45:31 +0000 (23:45 +0000)
          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 <varargs.h>.
        * remote-e7000.c: Likewise.

        * f-typeprint.c (f_type_print_base): Fix typo found by above
          changes.

16 files changed:
gdb/ChangeLog
gdb/complaints.c
gdb/complaints.h
gdb/defs.h
gdb/f-typeprint.c
gdb/gdbtk.c
gdb/language.c
gdb/language.h
gdb/monitor.c
gdb/monitor.h
gdb/printcmd.c
gdb/remote-array.c
gdb/remote-mips.c
gdb/remote-os9k.c
gdb/remote-st.c
gdb/utils.c

index a9ec6ce78d978cf871c0cd16fd9dd58fadec11a9..b9e336045b8faf96f922680442130051dc7e33a5 100644 (file)
@@ -1,3 +1,29 @@
+Thu May 18 15:58:46 1995  J.T. Conklin  <jtc@rtl.cygnus.com>
+
+       * 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 <varargs.h>.
+       * 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  <kingdon@deneb.cygnus.com>
 
        * Makefile.in (xcoffread.o): Depend on partial-stab.h.
index e441db4218d7d36c7f6e8dca7694075f14a70fe1..b551143715584cc9fe94ed3c7e78143d59f1e5f2 100644 (file)
@@ -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 <stdarg.h>
+#else
 #include <varargs.h>
+#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)
     {
index f7ff5a56814297774dd1f3399ae5353de0984801..881e484bb26671f8324e6ba453a3cadbf60fc98c 100644 (file)
@@ -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));
index 25c6fbc71f5821f1ce6c883c528af92034468fab..2ed546f44eeafaa2b603fe9aedde66e021f8ee9c 100644 (file)
@@ -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 *, ...));
 \f
 /* 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
index 699c61dbbf4ef891e61a23e6e142c4feef4f1a67..8775b379adccbcb8d747c0e4d2de8963e8038eef 100644 (file)
@@ -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);
index 802e0b916a9119fd8eb17a89fa8653f307f91718..848502503cbd0b4d394a1cf2d34f27a97fdf6515 100644 (file)
@@ -29,7 +29,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "target.h"
 #include <tcl.h>
 #include <tk.h>
+#ifdef __STDC__
+#include <stdarg.h>
+#else
 #include <varargs.h>
+#endif
 #include <signal.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -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)
 }
 \f
 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);
 
index a2dc7ba1cc59e0d40bc709874a1bf44a1494b057..3c27b7d91803f2fc7d3c777e5ca67366801fc128 100644 (file)
@@ -29,7 +29,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include "defs.h"
 #include <string.h>
+#ifdef __STDC__
+#include <stdarg.h>
+#else
 #include <varargs.h>
+#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);
index 02fccec1ee053671c57a9058b033522e66f2d070..9e77acc65ea831fab0c2ea53ae919758cbaff0db 100644 (file)
@@ -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?  */
 
index 5693d4c69fee0c431b0b725f69cee0d8dba510f5..ba54719548ce3f3292772f0e197d833351685977 100644 (file)
@@ -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 <stdarg.h>
+#else
 #include <varargs.h>
+#endif
 #include <signal.h>
 #include <string.h>
 #include <sys/types.h>
@@ -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);
 
index 64e78707fe2f259c318ca2c57d1005e80fc313d3..dde19aa0c274f5a6c9f0e5747c6d1828cc6503de 100644 (file)
@@ -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 *));
index bde7709daca9904536eee1ae5ac8a0273a1b3f23..e2718065e93ce2da55ffb65aeaf288173121e43e 100644 (file)
@@ -20,7 +20,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include "defs.h"
 #include <string.h>
-#include <varargs.h>
 #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)
        {
index 7f381cd07048c3d643c99242f43ac6cbbb42749f..dc1c4640465e6a41a1e5bbd67c920423afe1343d 100644 (file)
 #include "gdbcore.h"
 #include "target.h"
 #include "wait.h"
+#ifdef __STDC__
+#include <stdarg.h>
+#else
 #include <varargs.h>
+#endif
 #include <signal.h>
 #include <string.h>
 #include <sys/types.h>
@@ -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 */
index 2519f5371308b7b52f342e0ae9bd2c28711533e9..568694c6037a53aa3fd6c173d6d51365f992435a 100644 (file)
@@ -31,7 +31,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "remote-utils.h"
 
 #include <signal.h>
+#ifdef __STDC__
+#include <stdarg.h>
+#else
 #include <varargs.h>
+#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);
index a4f4e86a6c8bdf3e4bae128ceb3ce73ad95bbf15..2dc526c5d5bf7722bdd0aeaf447015fbd4dd2285 100644 (file)
@@ -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 <stdarg.h>
+#else
 #include <varargs.h>
+#endif
 #include <signal.h>
 #include <string.h>
 #include <sys/types.h>
@@ -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));
index 8bec2f5dc0a38f35531beaae27176af2256d403f..b74ba1318852ffc4d4b4deeaed55570db2d86d1c 100644 (file)
@@ -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 <stdarg.h>
+#else
 #include <varargs.h>
+#endif
 #include <signal.h>
 #include <string.h>
 #include <sys/types.h>
@@ -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));
 }
index dd3c746d77e234d7849419d6f61f1e19e3b43339..c11e15fc52ef098d18d5c7faf0ca0957c3cab7ec 100644 (file)
@@ -23,7 +23,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/param.h>
 #include <pwd.h>
 #endif
+#ifdef __STDC__
+#include <stdarg.h>
+#else
 #include <varargs.h>
+#endif
 #include <ctype.h>
 #include <string.h>
 
@@ -53,7 +57,7 @@ malloc_botch PARAMS ((void));
 #endif /* NO_MMALLOC, etc */
 
 static void
-fatal_dump_core ();    /* Can't prototype with <varargs.h> 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);