]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
third_party:quic_ko_wrapper Fix compilation with clang-20 master
authorGary Lockyer <gary@catalyst.net.nz>
Thu, 14 Aug 2025 21:38:07 +0000 (09:38 +1200)
committerBjörn Baumbach <bb@sernet.de>
Wed, 20 Aug 2025 15:04:34 +0000 (15:04 +0000)
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 <gary@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Wed Aug 20 15:04:34 UTC 2025 on atb-devel-224

third_party/quic_ko_wrapper/quic_ko_wrapper.c

index 576d8809c67b1d3dbc9cd86b57e62fe17d66d404..977611fdb20dd917dd3ba4811c7b099dff6b9a8c 100644 (file)
@@ -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;