Not all of this is really the way I prefer to see loops written, but
I accept that this helps the compiler to verify "array-ish lists with
a terminator (NULL)", so be it. Frank and Arne are fine with it.
BB did not test this (untrusted submitter), so I ran a few local tests,
including t_server and GHA runs, and submitted a "v2" to gerrit, which
basically is the same code just to trigger a full build.
There is one hunk here that leaves me feeling a bit uneasy
/* check if this object is the one we want to delete */
- if ((uint8_t *)(*e + 1) == buf->data)
+ if ((uintptr_t)*e + sizeof(struct gc_entry) == (uintptr_t)buf->data)
.. if structure-in-array packing ends up being not multiples of sizeof()
(due to alignment) this would produce different code - but I couldn't get
the FreeBSD clang to actually produce such a scenario (and maybe the C
standard is also clear on this).
Your patch has been applied to the master branch.
commit 16c3f4df69f51ffcf403527fbe0bc8c0bffd9417
Author: Jeff Bindel
Date: Tue Oct 27 14:02:45 2026 +0100
buffer: restructure some loops and assignments
Signed-off-by: Jeff Bindel <[email protected]>
Acked-by: Frank Lichtenheld <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2034
Message-Id: <[email protected]>
URL:
https://www.mail-archive.com/[email protected]/msg40197.html
Signed-off-by: Gert Doering <[email protected]>
--
kind regards,
Gert Doering
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel