From 26065e1f1ee111f5ddfb64782638492af65aeb95 Mon Sep 17 00:00:00 2001 From: Gary Lockyer Date: Fri, 15 Aug 2025 09:38:07 +1200 Subject: [PATCH] third_party:quic_ko_wrapper Fix compilation with clang-20 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- third_party/quic_ko_wrapper/quic_ko_wrapper.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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; -- 2.47.2