diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2017-09-21 14:09:33 +0200 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2017-09-21 14:09:33 +0200 |
commit | ebe48ba0856dcccaa7a60d873c61e6f1f96f5887 (patch) | |
tree | 7805e4f492d48fb8897323eb698ef5681a436d37 /gdb/microblaze-tdep.c | |
parent | 0a0bf5dc149ad79b325cdffb6b4e57be6c5ecbc2 (diff) | |
download | gdb-ebe48ba0856dcccaa7a60d873c61e6f1f96f5887.zip gdb-ebe48ba0856dcccaa7a60d873c61e6f1f96f5887.tar.gz gdb-ebe48ba0856dcccaa7a60d873c61e6f1f96f5887.tar.bz2 |
microblaze-tdep: Add ATTRIBUTE_PRINTF to microblaze_debug
I am getting this warning with clang:
/home/emaisin/src/binutils-gdb/gdb/microblaze-tdep.c:94:28: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
vprintf_unfiltered (fmt, args);
^~~
Adding ATTRIBUTE_PRINTF to microblaze_debug gets rid of it. Strangely,
gcc doesn't warn about non-literal format strings when calling vprintf
(or a vprintf-style function, like vprintf_unfiltered). I filed this
gcc bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82206
gdb/ChangeLog:
* microblaze-tdep.c (microblaze_debug): Add ATTRIBUTE_PRINTF.
Diffstat (limited to 'gdb/microblaze-tdep.c')
-rw-r--r-- | gdb/microblaze-tdep.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 7547581..caa7d2f 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -82,7 +82,7 @@ static const char *microblaze_register_names[] = static unsigned int microblaze_debug_flag = 0; -static void +static void ATTRIBUTE_PRINTF (1, 2) microblaze_debug (const char *fmt, ...) { if (microblaze_debug_flag) |