mirror of
https://salsa.debian.org/ha-team/libqb
synced 2026-08-08 20:07:21 +00:00
list: fix list handling for gcc10 (#383)
-Wpointer-arith has been removed from warnings as with GCC10 that warns every time qb_list_entry is used, which is just noise.
This commit is contained in:
parent
99671f4d75
commit
7f4600de1b
@ -601,7 +601,6 @@ WARNLIST="
|
||||
suggest-attribute=format
|
||||
property-attribute-mismatch
|
||||
strict-prototypes
|
||||
pointer-arith
|
||||
write-strings
|
||||
cast-align
|
||||
bad-function-cast
|
||||
|
||||
@ -193,8 +193,8 @@ static inline void qb_list_splice_tail(struct qb_list_head *list,
|
||||
* @param type: the type of the struct this is embedded in.
|
||||
* @param member: the name of the list_struct within the struct.
|
||||
*/
|
||||
#define qb_list_entry(ptr,type,member)\
|
||||
((type *)((char *)(ptr)-(char*)(&((type *)0)->member)))
|
||||
#define qb_list_entry(ptr,type,member) ({ \
|
||||
((type *)((void*)ptr - offsetof(type, member))); })
|
||||
|
||||
/**
|
||||
* Get the first element from a list
|
||||
|
||||
Loading…
Reference in New Issue
Block a user