Add ATTRIBUTE_PRINTF to printf_field_type_assignment
authorSimon Marchi <simon.marchi@polymtl.ca>
Sat, 23 Dec 2017 21:25:06 +0000 (16:25 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Sat, 23 Dec 2017 21:25:06 +0000 (16:25 -0500)
Get rid of:

/home/simark/src/binutils-gdb/gdb/target-descriptions.c:2026:25: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
    vprintf_unfiltered (fmt, args);

when building with clang.

gdb/ChangeLog:

* target-descriptions.c (print_c_tdesc)
<printf_field_type_assignment>: Add ATTRIBUTE_PRINTF.

gdb/ChangeLog
gdb/target-descriptions.c

index 1b4b13aba96c5cfef145fdd7a3a2424f87bdd6f0..c81c611e9a866739546e567208572740010a128f 100644 (file)
@@ -1,3 +1,8 @@
+2017-12-23  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * target-descriptions.c (print_c_tdesc)
+       <printf_field_type_assignment>: Add ATTRIBUTE_PRINTF.
+
 2017-12-21  Simon Marchi  <simon.marchi@ericsson.com>
            Sergio Durigan Junior  <sergiodj@redhat.com>
 
index 5dcc4c4c5c00a424cc5e22db2939b440377874e2..b37f4f0c193f5a4dfc652c2d67b8e523e8987d81 100644 (file)
@@ -2011,6 +2011,7 @@ private:
 
   /* Print an assignment to the field_type variable.  Print the declaration
      of field_type if that has not been done yet.  */
+  ATTRIBUTE_PRINTF (2, 3)
   void printf_field_type_assignment (const char *fmt, ...)
   {
     if (!m_printed_field_type)