1 From dc8aa43b7b6d0cead7d8a0c1a151d289a5233a10 Mon Sep 17 00:00:00 2001
2 From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
3 Date: Wed, 2 Apr 2014 12:36:52 +0200
4 Subject: [PATCH] libudev: Only use #pragma for ignoring diagnostics if GCC
7 [Peter: update for 2.1.1, fix shared_assert issue]
8 Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
10 src/shared/macro.h | 8 +++++
11 1 file changed, 8 insertions(+)
13 diff --git a/src/shared/macro.h b/src/shared/macro.h
14 --- a/src/shared/macro.h
15 +++ b/src/shared/macro.h
17 #define _cleanup_(x) __attribute__((cleanup(x)))
19 /* Temporarily disable some warnings */
20 +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
21 #define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
22 _Pragma("GCC diagnostic push"); \
23 _Pragma("GCC diagnostic ignored \"-Wdeclaration-after-statement\"")
26 #define REENABLE_WARNING \
27 _Pragma("GCC diagnostic pop")
29 +#define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT
30 +#define DISABLE_WARNING_FORMAT_NONLITERAL
31 +#define REENABLE_WARNING
32 +/* glibc unconditionally defines this, but it needs GCC 4.6+ */
36 #define XCONCATENATE(x, y) x ## y
37 #define CONCATENATE(x, y) XCONCATENATE(x, y)