diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5c3b45b5580..bcedf024482 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-10-13 Simon Marchi + + * ui-out.c (ui_out::call_do_message): Silence + -Wformat-nonliteral warning. + 2019-10-12 Simon Marchi * breakpoint.c: Remove some includes: continuations.h, skip.h, diff --git a/gdb/ui-out.c b/gdb/ui-out.c index a64c79481ca..6b0b5acd3e1 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -26,6 +26,7 @@ #include "ui-out.h" #include "gdbsupport/format.h" #include "cli/cli-style.h" +#include "diagnostics.h" #include #include @@ -587,7 +588,15 @@ ui_out::call_do_message (const ui_file_style &style, const char *format, va_list args; va_start (args, format); + + /* Since call_do_message is only used as a helper of vmessage, silence the + warning here once instead of at all call sites in vmessage, if we were + to put a "format" attribute on call_do_message. */ + DIAGNOSTIC_PUSH + DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL do_message (style, format, args); + DIAGNOSTIC_POP + va_end (args); }