From 5652987a6a500b56956ad20c4bf7d4ff1bce7f02 Mon Sep 17 00:00:00 2001 From: Jan Friesse Date: Tue, 25 Feb 2020 14:48:04 +0100 Subject: [PATCH] qblist: Retype ptr in qb_list_entry to char* This allows pointer arithmetics without issuing warning. Signed-off-by: Jan Friesse --- configure.ac | 1 + include/qb/qblist.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 108b2f188..ec8736cbf 100644 --- a/configure.ac +++ b/configure.ac @@ -601,6 +601,7 @@ WARNLIST=" suggest-attribute=format property-attribute-mismatch strict-prototypes + pointer-arith write-strings cast-align bad-function-cast diff --git a/include/qb/qblist.h b/include/qb/qblist.h index 160417e17..7e04efa05 100644 --- a/include/qb/qblist.h +++ b/include/qb/qblist.h @@ -195,7 +195,7 @@ static inline void qb_list_splice_tail(struct qb_list_head *list, * @param member: the name of the list_struct within the struct. */ #define qb_list_entry(ptr,type,member) ({ \ - ((type *)((void*)ptr - offsetof(type, member))); }) + ((type *)((char*)ptr - offsetof(type, member))); }) /** * Get the first element from a list