[PATCH] Avoid gnu_printf attribute when using Clang

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



From: Ed Maste <emaste@xxxxxxxxxxx>

Clang does not support gnu_printf, so just use printf when using it to
compile.

Signed-off-by: Ed Maste <emaste@xxxxxxxxxxx>
---
 util.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/util.h b/util.h
index 347b305..5a4172d 100644
--- a/util.h
+++ b/util.h
@@ -12,7 +12,11 @@
  */
 
 #ifdef __GNUC__
+#ifdef __clang__
+#define PRINTF(i, j)	__attribute__((format (printf, i, j)))
+#else
 #define PRINTF(i, j)	__attribute__((format (gnu_printf, i, j)))
+#endif
 #define NORETURN	__attribute__((noreturn))
 #else
 #define PRINTF(i, j)
-- 
2.23.0




[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux