# HG changeset patch
# User Piotr Sikora <piotr@aviatrix.com>
# Date 1714589495 0
# Wed May 01 18:51:35 2024 +0000
# Node ID 962cddbaecf02b9c213dca492a74b23924b8f24c
# Parent 49dce50fad40bf09db81ca2a35983ecd7b740e43
QUIC: fix build against musl-libc when using Clang.
Signed-off-by: Piotr Sikora <piotr@aviatrix.com>
diff -r 49dce50fad40 -r 962cddbaecf0 src/event/ngx_event_udp.c
--- a/src/event/ngx_event_udp.c Tue Apr 16 18:29:59 2024 +0400
+++ b/src/event/ngx_event_udp.c Wed May 01 18:51:35 2024 +0000
@@ -138,6 +138,14 @@
ngx_memcpy(&lsa, local_sockaddr, local_socklen);
local_sockaddr = &lsa.sockaddr;
+#ifndef __GLIBC__
+ /* Silence warnings from expanded CMSG_NXTHDR macro when using musl-libc. */
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wunknown-pragmas"
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wsign-compare"
+#endif
+
for (cmsg = CMSG_FIRSTHDR(&msg);
cmsg != NULL;
cmsg = CMSG_NXTHDR(&msg, cmsg))
@@ -148,6 +156,11 @@
}
}
+#ifndef __GLIBC__
+ #pragma clang diagnostic pop
+ #pragma GCC diagnostic pop
+#endif
+
#endif
c = ngx_lookup_udp_connection(ls, sockaddr, socklen, local_sockaddr,
diff -r 49dce50fad40 -r 962cddbaecf0 src/event/quic/ngx_event_quic_output.c
--- a/src/event/quic/ngx_event_quic_output.c Tue Apr 16 18:29:59 2024 +0400
+++ b/src/event/quic/ngx_event_quic_output.c Wed May 01 18:51:35 2024 +0000
@@ -434,10 +434,25 @@
*valp = segment;
#if (NGX_HAVE_ADDRINFO_CMSG)
+
+#ifndef __GLIBC__
+ /* Silence warnings from expanded CMSG_NXTHDR macro when using musl-libc. */
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wunknown-pragmas"
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wsign-compare"
+#endif
+
if (c->listening && c->listening->wildcard && c->local_sockaddr) {
cmsg = CMSG_NXTHDR(&msg, cmsg);
clen += ngx_set_srcaddr_cmsg(cmsg, c->local_sockaddr);
}
+
+#ifndef __GLIBC__
+ #pragma clang diagnostic pop
+ #pragma GCC diagnostic pop
+#endif
+
#endif
msg.msg_controllen = clen;
diff -r 49dce50fad40 -r 962cddbaecf0 src/event/quic/ngx_event_quic_udp.c
--- a/src/event/quic/ngx_event_quic_udp.c Tue Apr 16 18:29:59 2024 +0400
+++ b/src/event/quic/ngx_event_quic_udp.c Wed May 01 18:51:35 2024 +0000
@@ -140,6 +140,14 @@
ngx_memcpy(&lsa, local_sockaddr, local_socklen);
local_sockaddr = &lsa.sockaddr;
+#ifndef __GLIBC__
+ /* Silence warnings from expanded CMSG_NXTHDR macro when using musl-libc. */
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wunknown-pragmas"
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wsign-compare"
+#endif
+
for (cmsg = CMSG_FIRSTHDR(&msg);
cmsg != NULL;
cmsg = CMSG_NXTHDR(&msg, cmsg))
@@ -150,6 +158,11 @@
}
}
+#ifndef __GLIBC__
+ #pragma clang diagnostic pop
+ #pragma GCC diagnostic pop
+#endif
+
#endif
if (ngx_quic_get_packet_dcid(ev->log, buffer, n, &key) != NGX_OK) {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel