From: Gary Lockyer Date: Thu, 14 Aug 2025 21:38:07 +0000 (+1200) Subject: third_party:quic_ko_wrapper Fix compilation with clang-20 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fremotes%2Fgitlab%2Fmaster;p=thirdparty%2Fsamba.git third_party:quic_ko_wrapper Fix compilation with clang-20 Rework the code to remove the non portable variable length array in the union. Based on the code in wrap_msghdr_add_cmsghdr(). NOTE: this removes the 64 bit alignment, which I think should be ok. ./../third_party/quic_ko_wrapper/quic_ko_wrapper.c:3523:11: error: fields must have a constant size: 'variable length array in structure' extension will never be supported 3523 | uint8_t cmbuf[cmspace]; | ^ 1 error generated. Signed-off-by: Gary Lockyer Reviewed-by: Stefan Metzmacher Autobuild-User(master): Björn Baumbach Autobuild-Date(master): Wed Aug 20 15:04:34 UTC 2025 on atb-devel-224 --- diff --git a/third_party/quic_ko_wrapper/quic_ko_wrapper.c b/third_party/quic_ko_wrapper/quic_ko_wrapper.c index 576d8809c67..977611fdb20 100644 --- a/third_party/quic_ko_wrapper/quic_ko_wrapper.c +++ b/third_party/quic_ko_wrapper/quic_ko_wrapper.c @@ -3518,15 +3518,12 @@ static void qwrap_msghdr_add_cmsghdr(struct msghdr *msg, { size_t cmlen = CMSG_LEN(len); size_t cmspace = CMSG_SPACE(len); - union { - uint64_t cmalign64; - uint8_t cmbuf[cmspace]; - } cmu; - void *cast_ptr = (void *)cmu.cmbuf; + uint8_t cmbuf[cmspace]; + void *cast_ptr = (void *)cmbuf; struct cmsghdr *cm = (struct cmsghdr *)cast_ptr; uint8_t *p; - memset(cmu.cmbuf, 0, cmspace); + memset(cmbuf, 0, cmspace); if (msg->msg_controllen < cmlen) { cmlen = msg->msg_controllen;