mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-28 10:00:51 +00:00
* 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 <varargs.h>.
* remote-e7000.c: Likewise.
* f-typeprint.c (f_type_print_base): Fix typo found by above
changes.
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user