From c875217526e49b72322987f2e8a5476bb184f1eb Mon Sep 17 00:00:00 2001 From: Vojtech Horky Date: Sun, 10 Mar 2013 22:57:51 +0100 Subject: [PATCH] clang can check printf too (-Wformat) --- kernel/generic/include/printf/verify.h | 6 ++++++ uspace/lib/c/include/io/verify.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/kernel/generic/include/printf/verify.h b/kernel/generic/include/printf/verify.h index f8ecd07ad..28b8d45a3 100644 --- a/kernel/generic/include/printf/verify.h +++ b/kernel/generic/include/printf/verify.h @@ -37,8 +37,14 @@ #ifndef NVERIFY_PRINTF +#ifdef __clang__ +#define PRINTF_ATTRIBUTE(start, end) \ + __attribute__((format(__printf__, start, end))) +#else #define PRINTF_ATTRIBUTE(start, end) \ __attribute__((format(gnu_printf, start, end))) +#endif + #else /* NVERIFY_PRINTF */ diff --git a/uspace/lib/c/include/io/verify.h b/uspace/lib/c/include/io/verify.h index ca07ccbc6..868e9f2f1 100644 --- a/uspace/lib/c/include/io/verify.h +++ b/uspace/lib/c/include/io/verify.h @@ -37,8 +37,13 @@ #ifndef NVERIFY_PRINTF +#ifdef __clang__ +#define PRINTF_ATTRIBUTE(start, end) \ + __attribute__((format(__printf__, start, end))) +#else #define PRINTF_ATTRIBUTE(start, end) \ __attribute__((format(gnu_printf, start, end))) +#endif #else /* NVERIFY_PRINTF */ -- 2.11.4.GIT