* ada-lang.c (lim_warning): Change ATTR_FORMAT to ATTRIBUTE_PRINTF.
* amd64-tdep.c (amd64_insn_length_fprintf): Likewise.
* cli-out.c (cli_field_fmt): New ATTRIBUTE_PRINTF.
(cli_message, out_field_fmt): Change ATTR_FORMAT to ATTRIBUTE_PRINTF.
* complaints.c (find_complaint): New ATTRIBUTE_PRINTF.
(vcomplaint): Change ATTR_FORMAT to ATTRIBUTE_PRINTF.
* complaints.h (complaint, internal_complaint): Likewise.
* defs.h: Change ATTR_FORMAT to ATTRIBUTE_PRINTF in the top comment.
(ATTR_FORMAT): Remove.
(query, nquery, yquery, vprintf_filtered, vfprintf_filtered)
(fprintf_filtered, fprintfi_filtered, printf_filtered, printfi_filtered)
(vprintf_unfiltered, vfprintf_unfiltered, fprintf_unfiltered)
(printf_unfiltered, xasprintf, xvasprintf, xstrprintf, xstrvprintf)
(xsnprintf, verror, error, vfatal, fatal, internal_verror)
(internal_error, internal_vwarning, internal_warning, warning)
(vwarning): Change ATTR_FORMAT to ATTRIBUTE_PRINTF.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (exception_fprintf, throw_verror, throw_vfatal)
(throw_error): Likewise.
* language.h (type_error, range_error): Likewise.
* linespec.c (cplusplus_error): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* monitor.c (monitor_debug): Likewise.
* parser-defs.h (parser_fprintf): Likewise.
* serial.h (serial_printf): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem, defaulted_query):
Likewise.
* xml-support.h (gdb_xml_debug, gdb_xml_error): Likewise.
+2010-05-02 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * ada-lang.c (lim_warning): Change ATTR_FORMAT to ATTRIBUTE_PRINTF.
+ * amd64-tdep.c (amd64_insn_length_fprintf): Likewise.
+ * cli-out.c (cli_field_fmt): New ATTRIBUTE_PRINTF.
+ (cli_message, out_field_fmt): Change ATTR_FORMAT to ATTRIBUTE_PRINTF.
+ * complaints.c (find_complaint): New ATTRIBUTE_PRINTF.
+ (vcomplaint): Change ATTR_FORMAT to ATTRIBUTE_PRINTF.
+ * complaints.h (complaint, internal_complaint): Likewise.
+ * defs.h: Change ATTR_FORMAT to ATTRIBUTE_PRINTF in the top comment.
+ (ATTR_FORMAT): Remove.
+ (query, nquery, yquery, vprintf_filtered, vfprintf_filtered)
+ (fprintf_filtered, fprintfi_filtered, printf_filtered, printfi_filtered)
+ (vprintf_unfiltered, vfprintf_unfiltered, fprintf_unfiltered)
+ (printf_unfiltered, xasprintf, xvasprintf, xstrprintf, xstrvprintf)
+ (xsnprintf, verror, error, vfatal, fatal, internal_verror)
+ (internal_error, internal_vwarning, internal_warning, warning)
+ (vwarning): Change ATTR_FORMAT to ATTRIBUTE_PRINTF.
+ * disasm.c (fprintf_disasm): Likewise.
+ * exceptions.c (throw_it): Likewise.
+ * exceptions.h (exception_fprintf, throw_verror, throw_vfatal)
+ (throw_error): Likewise.
+ * language.h (type_error, range_error): Likewise.
+ * linespec.c (cplusplus_error): Likewise.
+ * mi/mi-interp.c (mi_interp_query_hook): Likewise.
+ * mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
+ * monitor.c (monitor_debug): Likewise.
+ * parser-defs.h (parser_fprintf): Likewise.
+ * serial.h (serial_printf): Likewise.
+ * tui/tui-hooks.c (tui_query_hook): Likewise.
+ * ui-out.c (default_field_fmt, default_message, uo_field_fmt)
+ (uo_message): Likewise.
+ * ui-out.h (ui_out_field_fmt, ui_out_message): Likewise.
+ * utils.c (vfprintf_maybe_filtered, internal_vproblem, defaulted_query):
+ Likewise.
+ * xml-support.h (gdb_xml_debug, gdb_xml_error): Likewise.
+
2010-05-02 Pedro Alves <pedro@codesourcery.com>
* cli-out.c (cli_table_begin, cli_table_body, cli_table_end)
/* FIXME: cagney/2004-10-10: This function is mimicking the behavior
provided by "complaint". */
-static void lim_warning (const char *format, ...) ATTR_FORMAT (printf, 1, 2);
+static void lim_warning (const char *format, ...) ATTRIBUTE_PRINTF (1, 2);
static void
lim_warning (const char *format, ...)
This function is a nop, we don't want to print anything, we just want to
compute the length of the insn. */
-static int ATTR_FORMAT (printf, 2, 3)
+static int ATTRIBUTE_PRINTF (2, 3)
amd64_insn_length_fprintf (void *stream, const char *format, ...)
{
return 0;
static void out_field_fmt (struct ui_out *uiout, int fldno,
const char *fldname,
- const char *format,...) ATTR_FORMAT (printf, 4, 5);
+ const char *format,...) ATTRIBUTE_PRINTF (4, 5);
/* These are the CLI output functions */
/* This is the only field function that does not align. */
-static void
+static void ATTRIBUTE_PRINTF (6, 0)
cli_field_fmt (struct ui_out *uiout, int fldno,
int width, enum ui_align align,
const char *fldname,
fputs_filtered (string, data->stream);
}
-static void ATTR_FORMAT (printf, 3,0)
+static void ATTRIBUTE_PRINTF (3, 0)
cli_message (struct ui_out *uiout, int verbosity,
const char *format, va_list args)
{
return (*c);
}
-static struct complain *
+static struct complain * ATTRIBUTE_PRINTF (4, 0)
find_complaint (struct complaints *complaints, const char *file,
int line, const char *fmt)
{
/* Print a complaint, and link the complaint block into a chain for
later handling. */
-static void ATTR_FORMAT (printf, 4, 0)
+static void ATTRIBUTE_PRINTF (4, 0)
vcomplaint (struct complaints **c, const char *file, int line, const char *fmt,
va_list args)
{
/* Register a complaint. */
extern void complaint (struct complaints **complaints, const char *fmt,
- ...) ATTR_FORMAT (printf, 2, 3);
+ ...) ATTRIBUTE_PRINTF (2, 3);
extern void internal_complaint (struct complaints **complaints,
const char *file, int line, const char *fmt,
- ...) ATTR_FORMAT (printf, 4, 5);
+ ...) ATTRIBUTE_PRINTF (4, 5);
/* Clear out / initialize all complaint counters that have ever been
incremented. If LESS_VERBOSE is 1, be less verbose about
-/* *INDENT-OFF* */ /* ATTR_FORMAT confuses indent, avoid running it for now */
+/* *INDENT-OFF* */ /* ATTRIBUTE_PRINTF confuses indent, avoid running it
+ for now. */
/* Basic, host-specific, and target-specific definitions for GDB.
Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009,
#endif
#endif
-#ifndef ATTR_FORMAT
-#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4))
-#define ATTR_FORMAT(type, x, y) __attribute__ ((format(type, x, y)))
-#else
-#define ATTR_FORMAT(type, x, y) /* nothing */
-#endif
-#endif
-
/* Be conservative and use enum bitfields only with GCC.
This is copied from gcc 3.3.1, system.h. */
extern int myread (int, char *, int);
-extern int query (const char *, ...) ATTR_FORMAT (printf, 1, 2);
-extern int nquery (const char *, ...) ATTR_FORMAT (printf, 1, 2);
-extern int yquery (const char *, ...) ATTR_FORMAT (printf, 1, 2);
+extern int query (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+extern int nquery (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+extern int yquery (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
extern void init_page_info (void);
extern void puts_debug (char *prefix, char *string, char *suffix);
-extern void vprintf_filtered (const char *, va_list) ATTR_FORMAT (printf, 1, 0);
+extern void vprintf_filtered (const char *, va_list) ATTRIBUTE_PRINTF (1, 0);
-extern void vfprintf_filtered (struct ui_file *, const char *, va_list) ATTR_FORMAT (printf, 2, 0);
+extern void vfprintf_filtered (struct ui_file *, const char *, va_list) ATTRIBUTE_PRINTF (2, 0);
-extern void fprintf_filtered (struct ui_file *, const char *, ...) ATTR_FORMAT (printf, 2, 3);
+extern void fprintf_filtered (struct ui_file *, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
-extern void fprintfi_filtered (int, struct ui_file *, const char *, ...) ATTR_FORMAT (printf, 3, 4);
+extern void fprintfi_filtered (int, struct ui_file *, const char *, ...) ATTRIBUTE_PRINTF (3, 4);
-extern void printf_filtered (const char *, ...) ATTR_FORMAT (printf, 1, 2);
+extern void printf_filtered (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
-extern void printfi_filtered (int, const char *, ...) ATTR_FORMAT (printf, 2, 3);
+extern void printfi_filtered (int, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
-extern void vprintf_unfiltered (const char *, va_list) ATTR_FORMAT (printf, 1, 0);
+extern void vprintf_unfiltered (const char *, va_list) ATTRIBUTE_PRINTF (1, 0);
-extern void vfprintf_unfiltered (struct ui_file *, const char *, va_list) ATTR_FORMAT (printf, 2, 0);
+extern void vfprintf_unfiltered (struct ui_file *, const char *, va_list) ATTRIBUTE_PRINTF (2, 0);
-extern void fprintf_unfiltered (struct ui_file *, const char *, ...) ATTR_FORMAT (printf, 2, 3);
+extern void fprintf_unfiltered (struct ui_file *, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
-extern void printf_unfiltered (const char *, ...) ATTR_FORMAT (printf, 1, 2);
+extern void printf_unfiltered (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
extern void print_spaces (int, struct ui_file *);
/* Like asprintf/vasprintf but get an internal_error if the call
fails. */
-extern void xasprintf (char **ret, const char *format, ...) ATTR_FORMAT (printf, 2, 3);
+extern void xasprintf (char **ret, const char *format, ...) ATTRIBUTE_PRINTF (2, 3);
extern void xvasprintf (char **ret, const char *format, va_list ap)
- ATTR_FORMAT (printf, 2, 0);
+ ATTRIBUTE_PRINTF (2, 0);
/* Like asprintf and vasprintf, but return the string, throw an error
if no memory. */
-extern char *xstrprintf (const char *format, ...) ATTR_FORMAT (printf, 1, 2);
+extern char *xstrprintf (const char *format, ...) ATTRIBUTE_PRINTF (1, 2);
extern char *xstrvprintf (const char *format, va_list ap)
- ATTR_FORMAT (printf, 1, 0);
+ ATTRIBUTE_PRINTF (1, 0);
/* Like snprintf, but throw an error if the output buffer is too small. */
extern int xsnprintf (char *str, size_t size, const char *format, ...)
- ATTR_FORMAT (printf, 3, 4);
+ ATTRIBUTE_PRINTF (3, 4);
extern int parse_escape (struct gdbarch *, char **);
extern char *warning_pre_print;
extern NORETURN void verror (const char *fmt, va_list ap)
- ATTR_NORETURN ATTR_FORMAT (printf, 1, 0);
+ ATTR_NORETURN ATTRIBUTE_PRINTF (1, 0);
-extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
+extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN ATTRIBUTE_PRINTF (1, 2);
extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN;
extern NORETURN void vfatal (const char *fmt, va_list ap)
- ATTR_NORETURN ATTR_FORMAT (printf, 1, 0);
+ ATTR_NORETURN ATTRIBUTE_PRINTF (1, 0);
-extern NORETURN void fatal (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
+extern NORETURN void fatal (const char *fmt, ...) ATTR_NORETURN ATTRIBUTE_PRINTF (1, 2);
extern NORETURN void internal_verror (const char *file, int line,
const char *, va_list ap)
- ATTR_NORETURN ATTR_FORMAT (printf, 3, 0);
+ ATTR_NORETURN ATTRIBUTE_PRINTF (3, 0);
extern NORETURN void internal_error (const char *file, int line,
- const char *, ...) ATTR_NORETURN ATTR_FORMAT (printf, 3, 4);
+ const char *, ...) ATTR_NORETURN ATTRIBUTE_PRINTF (3, 4);
extern void internal_vwarning (const char *file, int line,
const char *, va_list ap)
- ATTR_FORMAT (printf, 3, 0);
+ ATTRIBUTE_PRINTF (3, 0);
extern void internal_warning (const char *file, int line,
- const char *, ...) ATTR_FORMAT (printf, 3, 4);
+ const char *, ...) ATTRIBUTE_PRINTF (3, 4);
extern NORETURN void nomem (long) ATTR_NORETURN;
-extern void warning (const char *, ...) ATTR_FORMAT (printf, 1, 2);
+extern void warning (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
-extern void vwarning (const char *, va_list args) ATTR_FORMAT (printf, 1, 0);
+extern void vwarning (const char *, va_list args) ATTRIBUTE_PRINTF (1, 0);
/* List of known OS ABIs. If you change this, make sure to update the
table in osabi.c. */
/* Initialize the disassemble info struct ready for the specified
stream. */
-static int ATTR_FORMAT (printf, 2, 3)
+static int ATTRIBUTE_PRINTF (2, 3)
fprintf_disasm (void *stream, const char *format, ...)
{
va_list args;
}
}
-NORETURN static void ATTR_NORETURN ATTR_FORMAT (printf, 3, 0)
+NORETURN static void ATTR_NORETURN ATTRIBUTE_PRINTF (3, 0)
throw_it (enum return_reason reason, enum errors error, const char *fmt,
va_list ap)
{
extern void exception_print (struct ui_file *file, struct gdb_exception e);
extern void exception_fprintf (struct ui_file *file, struct gdb_exception e,
const char *prefix,
- ...) ATTR_FORMAT (printf, 3, 4);
+ ...) ATTRIBUTE_PRINTF (3, 4);
/* Throw an exception (as described by "struct gdb_exception"). Will
execute a LONG JUMP to the inner most containing exception handler
extern NORETURN void throw_exception (struct gdb_exception exception) ATTR_NORETURN;
extern NORETURN void throw_verror (enum errors, const char *fmt, va_list ap)
- ATTR_NORETURN ATTR_FORMAT (printf, 2, 0);
+ ATTR_NORETURN ATTRIBUTE_PRINTF (2, 0);
extern NORETURN void throw_vfatal (const char *fmt, va_list ap)
- ATTR_NORETURN ATTR_FORMAT (printf, 1, 0);
+ ATTR_NORETURN ATTRIBUTE_PRINTF (1, 0);
extern NORETURN void throw_error (enum errors error, const char *fmt,
- ...) ATTR_NORETURN ATTR_FORMAT (printf, 2, 3);
+ ...) ATTR_NORETURN ATTRIBUTE_PRINTF (2, 3);
/* Instead of deprecated_throw_reason, code should use catch_exception
and throw_exception. */
/* Error messages */
-extern void type_error (const char *, ...) ATTR_FORMAT (printf, 1, 2);
+extern void type_error (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
-extern void range_error (const char *, ...) ATTR_FORMAT (printf, 1, 2);
+extern void range_error (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
/* Data: Does this value represent "truth" to the current language? */
static NORETURN void cplusplus_error (const char *name,
const char *fmt, ...)
- ATTR_NORETURN ATTR_FORMAT (printf, 2, 3);
+ ATTR_NORETURN ATTRIBUTE_PRINTF (2, 3);
static int total_number_of_methods (struct type *type);
so we can report interesting things that happened "behind the mi's
back" in this command */
static int mi_interp_query_hook (const char *ctlstr, va_list ap)
- ATTR_FORMAT (printf, 1, 0);
+ ATTRIBUTE_PRINTF (1, 0);
static void mi3_command_loop (void);
static void mi2_command_loop (void);
static void mi_field_fmt (struct ui_out *uiout, int fldno,
int width, enum ui_align align,
const char *fldname, const char *format,
- va_list args) ATTR_FORMAT (printf, 6, 0);
+ va_list args) ATTRIBUTE_PRINTF (6, 0);
static void mi_spaces (struct ui_out *uiout, int numspaces);
static void mi_text (struct ui_out *uiout, const char *string);
static void mi_message (struct ui_out *uiout, int verbosity,
const char *format, va_list args)
- ATTR_FORMAT (printf, 3, 0);
+ ATTRIBUTE_PRINTF (3, 0);
static void mi_wrap_hint (struct ui_out *uiout, char *identstring);
static void mi_flush (struct ui_out *uiout);
/* Monitor specific debugging information. Typically only useful to
the developer of a new monitor interface. */
-static void monitor_debug (const char *fmt, ...) ATTR_FORMAT(printf, 1, 2);
+static void monitor_debug (const char *fmt, ...) ATTRIBUTE_PRINTF (1, 2);
static int monitor_debug_p = 0;
/* Function used to avoid direct calls to fprintf
in the code generated by the bison parser. */
-extern void parser_fprintf (FILE *, const char *, ...) ATTR_FORMAT (printf, 2 ,3);
+extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile);
/* Write a printf style string onto the serial port. */
extern void serial_printf (struct serial *desc,
- const char *,...) ATTR_FORMAT (printf, 2, 3);
+ const char *,...) ATTRIBUTE_PRINTF (2, 3);
/* Allow pending output to drain. */
tui_display_main ();
}
-static int ATTR_FORMAT (printf, 1, 0)
+static int ATTRIBUTE_PRINTF (1, 0)
tui_query_hook (const char *msg, va_list argp)
{
int retval;
int width, enum ui_align align,
const char *fldname,
const char *format,
- va_list args) ATTR_FORMAT (printf, 6, 0);
+ va_list args) ATTRIBUTE_PRINTF (6, 0);
static void default_spaces (struct ui_out *uiout, int numspaces);
static void default_text (struct ui_out *uiout, const char *string);
static void default_message (struct ui_out *uiout, int verbosity,
const char *format,
- va_list args) ATTR_FORMAT (printf, 3, 0);
+ va_list args) ATTRIBUTE_PRINTF (3, 0);
static void default_wrap_hint (struct ui_out *uiout, char *identstring);
static void default_flush (struct ui_out *uiout);
static void uo_field_fmt (struct ui_out *uiout, int fldno, int width,
enum ui_align align, const char *fldname,
const char *format, va_list args)
- ATTR_FORMAT (printf, 6, 0);
+ ATTRIBUTE_PRINTF (6, 0);
static void uo_spaces (struct ui_out *uiout, int numspaces);
static void uo_text (struct ui_out *uiout, const char *string);
static void uo_message (struct ui_out *uiout, int verbosity,
const char *format, va_list args)
- ATTR_FORMAT (printf, 3, 0);
+ ATTRIBUTE_PRINTF (3, 0);
static void uo_wrap_hint (struct ui_out *uiout, char *identstring);
static void uo_flush (struct ui_out *uiout);
static int uo_redirect (struct ui_out *uiout, struct ui_file *outstream);
extern void ui_out_field_fmt (struct ui_out *uiout, const char *fldname,
const char *format, ...)
- ATTR_FORMAT (printf, 3, 4);
+ ATTRIBUTE_PRINTF (3, 4);
extern void ui_out_field_skip (struct ui_out *uiout, const char *fldname);
extern void ui_out_message (struct ui_out *uiout, int verbosity,
const char *format, ...)
- ATTR_FORMAT (printf, 3, 4);
+ ATTRIBUTE_PRINTF (3, 4);
extern struct ui_stream *ui_out_stream_new (struct ui_out *uiout);
/* Prototypes for local functions */
static void vfprintf_maybe_filtered (struct ui_file *, const char *,
- va_list, int) ATTR_FORMAT (printf, 2, 0);
+ va_list, int) ATTRIBUTE_PRINTF (2, 0);
static void fputs_maybe_filtered (const char *, struct ui_file *, int);
has been reported, and assuming GDB didn't quit, the caller can
either allow execution to resume or throw an error. */
-static void ATTR_FORMAT (printf, 4, 0)
+static void ATTRIBUTE_PRINTF (4, 0)
internal_vproblem (struct internal_problem *problem,
const char *file, int line, const char *fmt, va_list ap)
{
ARGS are the arguments passed along with the CTLSTR argument to
printf. */
-static int ATTR_FORMAT (printf, 1, 0)
+static int ATTRIBUTE_PRINTF (1, 0)
defaulted_query (const char *ctlstr, const char defchar, va_list args)
{
int answer;
/* Issue a debugging message from one of PARSER's handlers. */
void gdb_xml_debug (struct gdb_xml_parser *parser, const char *format, ...)
- ATTR_FORMAT (printf, 2, 0);
+ ATTRIBUTE_PRINTF (2, 0);
/* Issue an error message from one of PARSER's handlers, and stop
parsing. */
void gdb_xml_error (struct gdb_xml_parser *parser, const char *format, ...)
- ATTR_NORETURN ATTR_FORMAT (printf, 2, 0);
+ ATTR_NORETURN ATTRIBUTE_PRINTF (2, 0);
/* Parse an integer attribute into a ULONGEST. */