Build fix: unknown warning -Wduplicated-branches
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 15 Jun 2022 19:00:35 +0000 (15:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 16 Jun 2022 16:37:01 +0000 (12:37 -0400)
-Wduplicated-branches was introduced in GCC 7. Only define
DIAGNOSTIC_IGNORE_DUPLICATED_BRANCHES for those more recent versions.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I3b50a671867a74629519375801bf2b4f3c597cd8

src/common/macros.hpp

index 37e6cabcf32e8701b369dab4ce96d3a17dc75724..cfe6eb5289d637ef1f1d1ddafe1b2f808a78535a 100644 (file)
@@ -276,9 +276,13 @@ void *memmove(T *d, const U *s, size_t n) = delete;
        _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"")
 # define DIAGNOSTIC_IGNORE_LOGICAL_OP \
        _Pragma("GCC diagnostic ignored \"-Wlogical-op\"")
-# define DIAGNOSTIC_IGNORE_DUPLICATED_BRANCHES \
+#if __GNUG__ && __GNUC__ >= 7
+# define DIAGNOSTIC_IGNORE_DUPLICATED_BRANCHES                         \
        _Pragma("GCC diagnostic ignored \"-Wduplicated-branches\"")
-# define DIAGNOSTIC_IGNORE_INVALID_OFFSETOF \
+#else
+# define DIAGNOSTIC_IGNORE_DUPLICATED_BRANCHES
+#endif /* __GNUG__ && __GNUC__ >= 7 */
+# define DIAGNOSTIC_IGNORE_INVALID_OFFSETOF                            \
        _Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")
 #endif
 
This page took 0.025192 seconds and 4 git commands to generate.