public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] gdb: add ATTRIBUTE_PRINTF to complaint_interceptor::issue_complaint
@ 2022-04-13 18:40 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2022-04-13 18:40 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

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 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gdb/complaints.h b/gdb/complaints.h
index 09d8cd39b276..68c79bd6d0a1 100644
--- a/gdb/complaints.h
+++ b/gdb/complaints.h
@@ -70,11 +70,12 @@ class complaint_interceptor
 
   /* 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;
-- 
2.26.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-13 18:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 18:40 [pushed] gdb: add ATTRIBUTE_PRINTF to complaint_interceptor::issue_complaint Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).