From: J.T. Conklin Date: Fri, 19 May 1995 22:44:51 +0000 (+0000) Subject: * defs.h (ATTR_FORMAT): New macro, expands to gcc's format X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e3033bb0860511d42dd38962b1dda9d2c1f7b79d;p=binutils-gdb.git * defs.h (ATTR_FORMAT): New macro, expands to gcc's format attribute when compiled by gcc. * defs.h, language.h, monitor.h: Changed many function declarations to use ATTR_FORMAT. * breakpoint.c (delete_command); source.c (directory_command); top.c (define_command): Changed call to query() that had too many arguments. * printcmd.c (address_info): Changed call to printf_filtered() that had too many arguments. --- diff --git a/gdb/language.h b/gdb/language.h index 9e77acc65ea..5c1e93b670f 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -395,10 +395,12 @@ op_error PARAMS ((char *fmt, enum exp_opcode, int)); op_error((f),(o),range_check==range_check_on ? 1 : 0) extern void -type_error PARAMS ((char *, ...)); +type_error PARAMS ((char *, ...)) + ATTR_FORMAT(printf, 1, 2); void -range_error PARAMS ((char *, ...)); +range_error PARAMS ((char *, ...)) + ATTR_FORMAT(printf, 1, 2); /* Data: Does this value represent "truth" to the current language? */ diff --git a/gdb/monitor.h b/gdb/monitor.h index dde19aa0c27..85de892c284 100644 --- a/gdb/monitor.h +++ b/gdb/monitor.h @@ -172,6 +172,8 @@ 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 PARAMS ((char *, ...)); -extern void monitor_printf_noecho PARAMS ((char *, ...)); +extern void monitor_printf PARAMS ((char *, ...)) + ATTR_FORMAT(printf, 1, 2); +extern void monitor_printf_noecho PARAMS ((char *, ...)) + ATTR_FORMAT(printf, 1, 2); extern void init_monitor_ops PARAMS ((struct target_ops *)); diff --git a/gdb/top.c b/gdb/top.c index 9b1c3dbbb4b..a3bc4bb113c 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -2619,7 +2619,7 @@ define_command (comname, from_tty) { warning ("Your new `%s' command does not hook any existing command.", comname); - if (!query ("Proceed? ", (char *)0)) + if (!query ("Proceed? ")) error ("Not confirmed."); } }