git: 74cac745fe30 - main - mxge(4): avoid clang 21 warning in NO-IP configuration
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 16 Jan 2026 23:32:20 UTC
The branch main has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=74cac745fe302b26ad22114f60735c8b73e90571
commit 74cac745fe302b26ad22114f60735c8b73e90571
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-01-15 11:31:29 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-01-16 23:31:50 +0000
mxge(4): avoid clang 21 warning in NO-IP configuration
Building the LINT-NOIP kernel on amd64 with clang 21 results in a
-Werror warning similar to:
sys/dev/mxge/if_mxge.c:1846:44: error: variable 'sum' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
1846 | cksum_offset, sizeof(sum), (caddr_t)&sum);
| ^~~
Indeed, if both `INET` and `INET6` are undefined, `sum` is never
initialized. Initialize it to zero to silence the warning.
Reviewed by: jhibbits
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D54730
---
sys/dev/mxge/if_mxge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/dev/mxge/if_mxge.c b/sys/dev/mxge/if_mxge.c
index f36f41d53b40..ca2267098c4f 100644
--- a/sys/dev/mxge/if_mxge.c
+++ b/sys/dev/mxge/if_mxge.c
@@ -1804,7 +1804,7 @@ mxge_encap_tso(struct mxge_slice_state *ss, struct mbuf *m,
uint32_t low, high_swapped;
int len, seglen, cum_len, cum_len_next;
int next_is_first, chop, cnt, rdma_count, small;
- uint16_t pseudo_hdr_offset, cksum_offset, mss, sum;
+ uint16_t pseudo_hdr_offset, cksum_offset, mss, sum = 0;
uint8_t flags, flags_next;
static int once;