git: 6380e5311239 - stable/14 - mxge(4): avoid clang 21 warning in NO-IP configuration
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 26 Jan 2026 08:41:50 UTC
The branch stable/14 has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=6380e53112394caa83ed9c123cc34858ea765e9f
commit 6380e53112394caa83ed9c123cc34858ea765e9f
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-01-15 11:31:29 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-01-26 08:30:26 +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
(cherry picked from commit 74cac745fe302b26ad22114f60735c8b73e90571)
---
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 097813b79c0f..4596372b6c91 100644
--- a/sys/dev/mxge/if_mxge.c
+++ b/sys/dev/mxge/if_mxge.c
@@ -1805,7 +1805,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;