aboutsummaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorEd Maste <emaste@freebsd.org>2019-11-20 21:04:22 +0000
committerDavid Gibson <david@gibson.dropbear.id.au>2019-11-21 12:31:36 +1100
commit34c82275bae6a1ff1350af036bfb5127f6bc1407 (patch)
tree0ea3d03aeadcef8bbc524c81783a62144edbec4e /util.h
parent743000931bc975810e13da2965ac2ef07166b4f3 (diff)
downloaddtc-34c82275bae6a1ff1350af036bfb5127f6bc1407.zip
dtc-34c82275bae6a1ff1350af036bfb5127f6bc1407.tar.gz
dtc-34c82275bae6a1ff1350af036bfb5127f6bc1407.tar.bz2
Avoid gnu_printf attribute when using Clang
Clang does not support gnu_printf, so just use printf when using it to compile. Signed-off-by: Ed Maste <emaste@freebsd.org> Message-Id: <20191120210422.61327-1-emaste@freefall.freebsd.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'util.h')
-rw-r--r--util.h4
1 files changed, 4 insertions, 0 deletions
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)