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