[gnome-builder] gdbwire: fix format string error when compiling with clang
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] gdbwire: fix format string error when compiling with clang
- Date: Sat, 6 Jan 2018 05:06:54 +0000 (UTC)
commit 53008a290eb04f3826c6948938fc170caa3d71e4
Author: Ting-Wei Lan <lantw src gnome org>
Date: Sat Jan 6 12:52:45 2018 +0800
gdbwire: fix format string error when compiling with clang
https://bugzilla.gnome.org/show_bug.cgi?id=791923
src/plugins/gdb/gdbwire.c | 6 +++++-
src/plugins/gdb/gdbwire.h | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gdb/gdbwire.c b/src/plugins/gdb/gdbwire.c
index 167e52d..bc8f64f 100644
--- a/src/plugins/gdb/gdbwire.c
+++ b/src/plugins/gdb/gdbwire.c
@@ -569,7 +569,11 @@ enum gdbwire_logger_level {
* Any additional format arguments.
*/
void gdbwire_logger_log(const char *file, int line,
- enum gdbwire_logger_level level, const char *fmt, ...);
+ enum gdbwire_logger_level level, const char *fmt, ...)
+#ifdef __GNUC__
+ __attribute__((__format__(__printf__, 4, 5)))
+#endif
+ ;
/* The macros intended to be used for logging */
#define gdbwire_debug(fmt, ...)(gdbwire_logger_log(__FILE__, __LINE__, \
diff --git a/src/plugins/gdb/gdbwire.h b/src/plugins/gdb/gdbwire.h
index 8f72527..a178f12 100644
--- a/src/plugins/gdb/gdbwire.h
+++ b/src/plugins/gdb/gdbwire.h
@@ -330,7 +330,11 @@ enum gdbwire_logger_level {
* Any additional format arguments.
*/
void gdbwire_logger_log(const char *file, int line,
- enum gdbwire_logger_level level, const char *fmt, ...);
+ enum gdbwire_logger_level level, const char *fmt, ...)
+#ifdef __GNUC__
+ __attribute__((__format__(__printf__, 4, 5)))
+#endif
+ ;
/* The macros intended to be used for logging */
#define gdbwire_debug(fmt, ...)(gdbwire_logger_log(__FILE__, __LINE__, \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]