2014-04-02 16:42:26 +02:00
|
|
|
From dc8aa43b7b6d0cead7d8a0c1a151d289a5233a10 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
|
|
|
|
Date: Wed, 2 Apr 2014 12:36:52 +0200
|
|
|
|
Subject: [PATCH] libudev: Only use #pragma for ignoring diagnostics if GCC
|
|
|
|
version supports it.
|
|
|
|
|
2015-01-23 17:12:13 +01:00
|
|
|
[Peter: update for 2.1.1, fix shared_assert issue]
|
2014-04-02 16:42:26 +02:00
|
|
|
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
|
|
|
|
---
|
2015-01-23 17:12:13 +01:00
|
|
|
src/shared/macro.h | 8 +++++
|
|
|
|
1 file changed, 8 insertions(+)
|
2014-04-02 16:42:26 +02:00
|
|
|
|
2015-01-23 17:12:13 +01:00
|
|
|
diff --git a/src/shared/macro.h b/src/shared/macro.h
|
|
|
|
--- a/src/shared/macro.h
|
|
|
|
+++ b/src/shared/macro.h
|
|
|
|
@@ -38,6 +38,7 @@
|
2014-04-02 16:42:26 +02:00
|
|
|
#define _cleanup_(x) __attribute__((cleanup(x)))
|
|
|
|
|
2015-01-23 17:12:13 +01:00
|
|
|
/* Temporarily disable some warnings */
|
2014-04-02 16:42:26 +02:00
|
|
|
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
|
2015-01-23 17:12:13 +01:00
|
|
|
#define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
|
2014-04-02 16:42:26 +02:00
|
|
|
_Pragma("GCC diagnostic push"); \
|
2015-01-23 17:12:13 +01:00
|
|
|
_Pragma("GCC diagnostic ignored \"-Wdeclaration-after-statement\"")
|
|
|
|
@@ -48,6 +49,13 @@
|
2014-04-02 16:42:26 +02:00
|
|
|
|
|
|
|
#define REENABLE_WARNING \
|
|
|
|
_Pragma("GCC diagnostic pop")
|
|
|
|
+#else
|
2015-01-23 17:12:13 +01:00
|
|
|
+#define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT
|
2014-04-02 16:42:26 +02:00
|
|
|
+#define DISABLE_WARNING_FORMAT_NONLITERAL
|
|
|
|
+#define REENABLE_WARNING
|
2015-01-23 17:12:13 +01:00
|
|
|
+/* glibc unconditionally defines this, but it needs GCC 4.6+ */
|
|
|
|
+#undef static_assert
|
2014-04-02 16:42:26 +02:00
|
|
|
+#endif
|
|
|
|
|
2015-01-23 17:12:13 +01:00
|
|
|
#define XCONCATENATE(x, y) x ## y
|
|
|
|
#define CONCATENATE(x, y) XCONCATENATE(x, y)
|
2014-04-02 16:42:26 +02:00
|
|
|
--
|
|
|
|
1.7.9.5
|