aboutsummaryrefslogtreecommitdiff
path: root/gdb/xml-support.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-03-27 12:28:03 +0100
committerPedro Alves <palves@redhat.com>2017-03-27 12:28:03 +0100
commit210477268d4ac5cad937e811888a5c932206794c (patch)
tree70565a15b6b77a2cfe1d9c028d2b2f33c3b0544d /gdb/xml-support.h
parent9b7539374617a94c2d646f49e1bbfc954b11891d (diff)
downloadgdb-210477268d4ac5cad937e811888a5c932206794c.zip
gdb-210477268d4ac5cad937e811888a5c932206794c.tar.gz
gdb-210477268d4ac5cad937e811888a5c932206794c.tar.bz2
Fix gdb_xml_debug/gdb_xml_error ATTRIBUTE_PRINTF use
The declarations of gdb_xml_debug and gdb_xml_error are passing "0" as "first-to-check" argument to ATTRIBUTE_PRINTF, as if they were va_args functions. Consequently, the arguments to gdb_xml_debug / gdb_xml_error aren't being checked against the format strings. With that fixed, a couple obvious bugs are exposed, both fixed by this commit. gdb/ChangeLog: 2017-03-27 Pedro Alves <palves@redhat.com> * xml-support.h (gdb_xml_debug): Pass a "first-to-check" argument to ATTRIBUTE_PRINTF. * solib-target.c (library_list_start_list): Print "string" not "version". * xml-tdesc.c (tdesc_start_field): Pass "field_name" to gdb_xml_error call.
Diffstat (limited to 'gdb/xml-support.h')
-rw-r--r--gdb/xml-support.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/xml-support.h b/gdb/xml-support.h
index 9d4e29f..de685e2 100644
--- a/gdb/xml-support.h
+++ b/gdb/xml-support.h
@@ -200,13 +200,13 @@ int gdb_xml_parse_quick (const char *name, const char *dtd_name,
/* Issue a debugging message from one of PARSER's handlers. */
void gdb_xml_debug (struct gdb_xml_parser *parser, const char *format, ...)
- ATTRIBUTE_PRINTF (2, 0);
+ ATTRIBUTE_PRINTF (2, 3);
/* 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, ...)
- ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 0);
+ ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 3);
/* Find the attribute named NAME in the set of parsed attributes
ATTRIBUTES. Returns NULL if not found. */