blob: b4ce132a254c79b3677c58b917c007eeba80f864 [file] [log] [blame]
From d65c325dd8681edf2ee3332eeb0a547229c7ffb5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 24 Aug 2017 15:54:47 -0700
Subject: [PATCH] efivar-dp.h: Add -Wunknown-attributes when using clang
change !dp check to a comparision against NULL to silent clang warning
nonnull parameter 'dp' will evaluate to 'true' on first encounter
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/include/efivar/efivar-dp.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/include/efivar/efivar-dp.h b/src/include/efivar/efivar-dp.h
index 3a509b7..c140e8d 100644
--- a/src/include/efivar/efivar-dp.h
+++ b/src/include/efivar/efivar-dp.h
@@ -783,9 +783,14 @@ extern int efidp_append_instance(const_efidp dp, const_efidp dpi, efidp *out);
* though older or other compilers might just ignore that attribute if they
* don't support it. Ugh.
*/
+#pragma GCC diagnostic push
#if defined(__GNUC__) && __GNUC__ >= 6
#pragma GCC diagnostic ignored "-Wnonnull-compare"
#endif
+#if defined(__clang__)
+#pragma GCC diagnostic ignored "-Wunknown-attributes"
+#pragma GCC diagnostic ignored "-Wpointer-bool-conversion"
+#endif
static inline int16_t
__attribute__((__artificial__))