mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
ldb:dlinklist: avoid -Wtautological-compare errors with gcc6
We expect these macros to generate tautological compares intentionally, so disabling the warning is just fine. This lets --pick-developer work with gcc6 and newer. Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Ira Cooper <ira@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jul 14 05:44:21 CEST 2016 on sn-devel-144
This commit is contained in:
parent
2991f77099
commit
7c9505e651
@ -83,6 +83,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; \
|
||||
@ -94,6 +97,7 @@ do { \
|
||||
if ((p)->next) (p)->next->prev = (p)->prev; \
|
||||
} \
|
||||
if ((p) != (list)) (p)->next = (p)->prev = NULL; \
|
||||
_Pragma ("GCC diagnostic pop") \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
@ -124,7 +128,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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user