]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: add ATTRIBUTE_PRINTF to complaint_interceptor::issue_complaint
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 13 Apr 2022 15:15:38 +0000 (11:15 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 13 Apr 2022 18:39:14 +0000 (14:39 -0400)
Fix this error when building with clang++-14:

      CXX    complaints.o
    /home/smarchi/src/binutils-gdb/gdb/complaints.c:130:65: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
      g_complaint_interceptor->m_complaints.insert (string_vprintf (fmt, args));
                                                                    ^~~

Change-Id: I0ef11f970510eb8638d1651fa0d5eeecd6a9d31a

gdb/complaints.h

index 09d8cd39b276dad190d98a9d8f01f45c08fdffee..68c79bd6d0a1f99994805b976bca082d6ad1db88 100644 (file)
@@ -70,11 +70,12 @@ private:
 
   /* The saved value of deprecated_warning_hook.  */
   void (*m_saved_warning_hook) (const char *, va_list)
-    ATTRIBUTE_FPTR_PRINTF(1,0);
+    ATTRIBUTE_FPTR_PRINTF (1,0);
 
   /* A helper function that is used by the 'complaint' implementation
      to issue a complaint.  */
-  static void issue_complaint (const char *, va_list);
+  static void issue_complaint (const char *, va_list)
+    ATTRIBUTE_PRINTF (1, 0);
 
   /* This object.  Used by the static callback function.  */
   static complaint_interceptor *g_complaint_interceptor;