summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2016-07-13 12:36:21 +0200
committerJeremy Allison <jra@samba.org>2016-07-14 02:06:10 +0200
commit2991f7709973fdcc2c0b83bbe15dda3f1ceae9b3 (patch)
tree37d9477af30ceba7feb6aed3cde5ae3b4528b5f4
parent5d85fd85467eb1f8941641d5f71d75e7d5c7234c (diff)
downloadsamba-2991f7709973fdcc2c0b83bbe15dda3f1ceae9b3.tar.gz
tevent: avoid -Wtautological-compare errors with gcc6
We expect these macros to generate tautological compares intentionally, so disabling the warning is just fine. This lets --picky-developer work with gcc6 and newer. Pair-Programmed-With: Ira Cooper <ira@samba.org> Signed-off-by: Ira Cooper <ira@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--lib/tevent/tevent_util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/tevent/tevent_util.h b/lib/tevent/tevent_util.h
index e2cdbb8d385..eb7586fd356 100644
--- a/lib/tevent/tevent_util.h
+++ b/lib/tevent/tevent_util.h
@@ -79,6 +79,9 @@ do { \
*/
#define DLIST_REMOVE(list, p) \
do { \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wpragmas\"") \
+ _Pragma ("GCC diagnostic ignored \"-Wtautological-compare\"") \
if ((p) == (list)) { \
if ((p)->next) (p)->next->prev = (p)->prev; \
(list) = (p)->next; \
@@ -90,6 +93,7 @@ do { \
if ((p)->next) (p)->next->prev = (p)->prev; \
} \
if ((p) != (list)) (p)->next = (p)->prev = NULL; \
+ _Pragma ("GCC diagnostic pop") \
} while (0)
/*
@@ -120,7 +124,11 @@ do { \
(p)->next = (el)->next; \
(el)->next = (p); \
if ((p)->next) (p)->next->prev = (p); \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wpragmas\"") \
+ _Pragma ("GCC diagnostic ignored \"-Wtautological-compare\"") \
if ((list)->prev == (el)) (list)->prev = (p); \
+ _Pragma ("GCC diagnostic pop") \
}\
} while (0)