1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

lib: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 --picky-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>
This commit is contained in:
Ira Cooper 2016-07-13 12:35:13 +02:00 committed by Jeremy Allison
parent f6d4380a9d
commit 5d85fd8546

View File

@ -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)