]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
third_party:ngtcp2 Fix compilation with clang-20
authorGary Lockyer <gary@catalyst.net.nz>
Tue, 12 Aug 2025 23:52:36 +0000 (11:52 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 13 Aug 2025 03:58:43 +0000 (03:58 +0000)
Add -Wno-error=implicit-fallthrough and -Wno-error=format-nonliteral so that
ngtcp2 builds with clang 20

[1972/4994] Compiling third_party/ngtcp2/lib/ngtcp2_objalloc.c
../../third_party/ngtcp2/lib/ngtcp2_rtb.c:1120:7: error:
   unannotated fall-through between switch labels
   [-Werror,-Wimplicit-fallthrough]
   1120 |       case NGTCP2_ECN_STATE_UNKNOWN:
        |       ^
../../third_party/ngtcp2/lib/ngtcp2_rtb.c:1120:7: note:
   insert '__attribute__((fallthrough));' to silence this warning
   1120 |       case NGTCP2_ECN_STATE_UNKNOWN:
        |       ^
        |       __attribute__((fallthrough));
../../third_party/ngtcp2/lib/ngtcp2_rtb.c:1120:7: note:
   insert 'break;' to avoid fall-through
   1120 |       case NGTCP2_ECN_STATE_UNKNOWN:
        |       ^
        |       break;
1 error generated.

../../third_party/ngtcp2/lib/ngtcp2_log.c:818:35: error:
   format string is not a string literal [-Werror,-Wformat-nonliteral]
   818 |   n = vsnprintf(buf, sizeof(buf), fmt, ap);
       |                                   ^~~
1 error generated.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Aug 13 03:58:43 UTC 2025 on atb-devel-224

third_party/ngtcp2/wscript

index f4cfd1c70644ebed90ff0e74f78f9e4f0703ddd3..57eb530e7ebdaeb95fd85ce5034e45bb5c46a0d0 100644 (file)
@@ -38,6 +38,12 @@ def configure(conf):
     conf.ADD_NAMED_CFLAGS('LIBNGTCP2_UNPICKY_CFLAGS',
                           '-Wno-error=strict-overflow',
                           testflags=True)
+    conf.ADD_NAMED_CFLAGS('LIBNGTCP2_UNPICKY_CFLAGS',
+                          '-Wno-error=format-nonliteral',
+                          testflags=True)
+    conf.ADD_NAMED_CFLAGS('LIBNGTCP2_UNPICKY_CFLAGS',
+                          '-Wno-error=implicit-fallthrough',
+                          testflags=True)
 
     conf.DEFINE('HAVE_LIBNGTCP2', '1')
     return