diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2018-09-05 21:21:51 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-09-05 21:47:33 -0600 |
commit | af39b1c216ffb11e6ca8e8607b00749e0fc1ab41 (patch) | |
tree | 2c1e035ca006f6e98e6b9d844f3139ad386b9d21 /include | |
parent | 4f075c06a3adbccdc2712c3e24afc7d4814149c7 (diff) | |
download | gdb-af39b1c216ffb11e6ca8e8607b00749e0fc1ab41.zip gdb-af39b1c216ffb11e6ca8e8607b00749e0fc1ab41.tar.gz gdb-af39b1c216ffb11e6ca8e8607b00749e0fc1ab41.tar.bz2 |
Disable -Wformat-nonliteral in parts of printcmd.c
commit 3322c5d9a1 ("Remove unneeded explicit .o targets") broke the
build with clang, because -Wno-format-nonliteral was in fact needed.
This patch fixes the problem by introducing
DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL and using it in printcmd.c. This
seems preferable to reverting the patch because now the warning
suppression is more targeted.
gdb/ChangeLog
2018-09-05 Simon Marchi <simon.marchi@ericsson.com>
* printcmd.c (printf_c_string): Use
DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL.
(printf_wide_c_string, printf_pointer, ui_printf): Likewise.
include/ChangeLog
2018-09-05 Simon Marchi <simon.marchi@ericsson.com>
* diagnostics.h (DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL): New macro.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 4 | ||||
-rw-r--r-- | include/diagnostics.h | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 63fdde6..c23c743 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2018-09-05 Simon Marchi <simon.marchi@ericsson.com> + + * diagnostics.h (DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL): New macro. + 2018-08-31 Alan Modra <amodra@gmail.com> * elf/ppc64.h (R_PPC64_REL16_HIGH, R_PPC64_REL16_HIGHA), diff --git a/include/diagnostics.h b/include/diagnostics.h index 9e9d1a8..79e6779 100644 --- a/include/diagnostics.h +++ b/include/diagnostics.h @@ -59,6 +59,10 @@ # define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES \ DIAGNOSTIC_IGNORE ("-Wenum-compare-switch") # endif + +# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \ + DIAGNOSTIC_IGNORE ("-Wformat-nonliteral") + #elif defined (__GNUC__) /* GCC */ # define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \ @@ -66,6 +70,10 @@ # define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION \ DIAGNOSTIC_IGNORE ("-Wstringop-truncation") + +# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \ + DIAGNOSTIC_IGNORE ("-Wformat-nonliteral") + #endif #ifndef DIAGNOSTIC_IGNORE_SELF_MOVE @@ -92,4 +100,8 @@ # define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION #endif +#ifndef DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL +# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL +#endif + #endif /* DIAGNOSTICS_H */ |