aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-06-27 14:38:43 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-06-27 14:39:00 -0400
commit6db3031e5c8bbe94e2111633273d8e69e724220a (patch)
treecea4ea1a2dcc01f289045bada56003aee4c9d9a6 /gdbsupport
parent05779d57f9f4e7cbb6d4c79d8851d35a422bdd0d (diff)
downloadgdb-6db3031e5c8bbe94e2111633273d8e69e724220a.zip
gdb-6db3031e5c8bbe94e2111633273d8e69e724220a.tar.gz
gdb-6db3031e5c8bbe94e2111633273d8e69e724220a.tar.bz2
gdbsupport: add format attribute to print_xml_feature::add_line
Fixes this clang error: CXX tdesc.o /home/smarchi/src/binutils-gdb/gdbsupport/tdesc.cc:444:25: error: format string is not a string literal [-Werror,-Wformat-nonliteral] string_vappendf (tmp, fmt, ap); ^~~ There is already a but about GCC not emitting this warning: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82206 gdbsupport/ChangeLog: * tdesc.h (class print_xml_feature) <add_line>: Add ATTRIBUTE_PRINTF. Change-Id: I7014075e83717f6d7e19d044a3675ff9981ebe17
Diffstat (limited to 'gdbsupport')
-rw-r--r--gdbsupport/ChangeLog5
-rw-r--r--gdbsupport/tdesc.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog
index b2fbc56..4db482b 100644
--- a/gdbsupport/ChangeLog
+++ b/gdbsupport/ChangeLog
@@ -1,3 +1,8 @@
+2020-06-27 Simon Marchi <simon.marchi@efficios.com>
+
+ * tdesc.h (class print_xml_feature) <add_line>: Add
+ ATTRIBUTE_PRINTF.
+
2020-06-23 Andrew Burgess <andrew.burgess@embecosm.com>
* tdesc.cc (print_xml_feature::visit_pre): Use add_line to add
diff --git a/gdbsupport/tdesc.h b/gdbsupport/tdesc.h
index 73caf24..456e8e0 100644
--- a/gdbsupport/tdesc.h
+++ b/gdbsupport/tdesc.h
@@ -438,7 +438,7 @@ private:
functions appends a newline, so don't include one in the strings being
passed. */
void add_line (const std::string &str);
- void add_line (const char *fmt, ...);
+ void add_line (const char *fmt, ...) ATTRIBUTE_PRINTF (2, 3);
/* The buffer we are writing too. */
std::string *m_buffer;