git: ebdbb70a589d - stable/12 - Suppress unused variable warning in ip_dummynet.c
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 23 Jul 2022 08:59:06 UTC
The branch stable/12 has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=ebdbb70a589debb15586d715bf2dd70fb767f884
commit ebdbb70a589debb15586d715bf2dd70fb767f884
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-19 19:43:46 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-23 08:57:44 +0000
Suppress unused variable warning in ip_dummynet.c
With clang 15, the following -Werror warning is produced:
sys/netpfil/ipfw/ip_dummynet.c:802:6: error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable]
int n = 0; /* only for stats */
^
Here, 'n' is a variable that is only used when debugging. Mark the
variable as potentially unused, to suppress the warning.
MFC after: 3 days
(cherry picked from commit 5c329f0a4d32cec54250ec2d3f61455e85137a6f)
---
sys/netpfil/ipfw/ip_dummynet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/netpfil/ipfw/ip_dummynet.c b/sys/netpfil/ipfw/ip_dummynet.c
index a637d4bbd317..bba731969887 100644
--- a/sys/netpfil/ipfw/ip_dummynet.c
+++ b/sys/netpfil/ipfw/ip_dummynet.c
@@ -788,7 +788,7 @@ static void
fsk_detach_list(struct dn_fsk_head *h, int flags)
{
struct dn_fsk *fs;
- int n = 0; /* only for stats */
+ int n __unused = 0; /* only for stats */
ND("head %p flags %x", h, flags);
while ((fs = SLIST_FIRST(h))) {