[master] 9611d7f0d Flexelint silencing
Nils Goroll
nils.goroll at uplex.de
Fri Jul 4 17:31:05 UTC 2025
commit 9611d7f0de67403f9c452ee258e1b197cac80b63
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Fri Jul 4 19:28:52 2025 +0200
Flexelint silencing
I had not seen this on linux, and I suspect the reason is that on the bsd
running the CI-flexelint, offsetof() is defined as some pointer difference using
the & operator.
#... ave -e413 */(offsetof(struct vscarab, s) + (save2910) * sizeof(((struct v
#... arab), 0, VFLA_SIZE(vscarab, s, save2910)); (scarab)->magic = (0x05ca7ab0)
#... 0, s, scarab->capacity, VUNIQ_NAME(save))
#... arab, VSCARAB_MAGIC, s, scarab->capacity)
VSCARAB_INIT(scarab, scarab->capacity);
Warning 545: Suspicious use of &
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 55553e707..8885721d6 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -815,6 +815,7 @@ struct vscarab {
// VFLA_SIZE ignores the cap == 0 case, we assert in _INIT
// offsetoff ref: https://gustedt.wordpress.com/2011/03/14/flexible-array-member/
//lint -emacro(413, VFLA_SIZE)
+//lint -emacro(545, VFLA_SIZE) bsd offsetof() seems to be using &
#define VFLA_SIZE(type, fam, cap) (offsetof(struct type, fam) + \
(cap) * sizeof(((struct type *)0)->fam[0]))
#define VFLA_INIT_(type, cptr, mag, fam, cap, save) do { \
More information about the varnish-commit
mailing list