Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From d65c325dd8681edf2ee3332eeb0a547229c7ffb5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 24 Aug 2017 15:54:47 -0700 |
| 4 | Subject: [PATCH] efivar-dp.h: Add -Wunknown-attributes when using clang |
| 5 | |
| 6 | change !dp check to a comparision against NULL to silent clang warning |
| 7 | nonnull parameter 'dp' will evaluate to 'true' on first encounter |
| 8 | |
| 9 | Signed-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 | |
| 15 | diff --git a/src/include/efivar/efivar-dp.h b/src/include/efivar/efivar-dp.h |
| 16 | index 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__)) |