Subtracting (char *)0 is undefined behavior. Newer compilers warn about this unless it is done in system headers. Signed-off-by: Richard Palethorpe <rpalethorpe@xxxxxxxx> --- token.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/token.h b/token.h index bccac0e4..9000e0cb 100644 --- a/token.h +++ b/token.h @@ -201,7 +201,7 @@ struct token { static inline struct token *containing_token(struct token **p) { - void *addr = (char *)p - ((char *)&((struct token *)0)->next - (char *)0); + void *addr = (char *)p - offsetof(struct token, next); return addr; } -- 2.35.1