git: 62030bb8538c - main - Adjust ipfw_{init,destroy}_*() definitions to avoid clang 15 warning
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 21 Jul 2022 19:53:31 UTC
The branch main has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=62030bb8538cb3775f6259c81c2c30a533f3ab10
commit 62030bb8538cb3775f6259c81c2c30a533f3ab10
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-21 19:23:13 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-21 19:30:29 +0000
Adjust ipfw_{init,destroy}_*() definitions to avoid clang 15 warning
With clang 15, the following -Werror warnings are produced:
sys/netpfil/ipfw/ip_fw_sockopt.c:187:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
ipfw_init_counters()
^
void
sys/netpfil/ipfw/ip_fw_sockopt.c:196:22: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
ipfw_destroy_counters()
^
void
sys/netpfil/ipfw/ip_fw_sockopt.c:3241:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
ipfw_init_obj_rewriter()
^
void
sys/netpfil/ipfw/ip_fw_sockopt.c:3249:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
ipfw_destroy_obj_rewriter()
^
void
This is because ipfw_init_counters(), ipfw_destroy_counters(),
ipfw_init_obj_rewriter(), and ipfw_destroy_obj_rewriter() are declared
with (void) argument lists, but defined with empty argument lists. Make
the definitions match the declarations.
MFC after: 3 days
---
sys/netpfil/ipfw/ip_fw_sockopt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c
index 9505fa70f69a..fd50df8dc412 100644
--- a/sys/netpfil/ipfw/ip_fw_sockopt.c
+++ b/sys/netpfil/ipfw/ip_fw_sockopt.c
@@ -184,7 +184,7 @@ VNET_DEFINE_STATIC(uma_zone_t, ipfw_cntr_zone);
#define V_ipfw_cntr_zone VNET(ipfw_cntr_zone)
void
-ipfw_init_counters()
+ipfw_init_counters(void)
{
V_ipfw_cntr_zone = uma_zcreate("IPFW counters",
@@ -193,7 +193,7 @@ ipfw_init_counters()
}
void
-ipfw_destroy_counters()
+ipfw_destroy_counters(void)
{
uma_zdestroy(V_ipfw_cntr_zone);
@@ -3238,7 +3238,7 @@ update_opcode_kidx(ipfw_insn *cmd, uint16_t idx)
}
void
-ipfw_init_obj_rewriter()
+ipfw_init_obj_rewriter(void)
{
ctl3_rewriters = NULL;
@@ -3246,7 +3246,7 @@ ipfw_init_obj_rewriter()
}
void
-ipfw_destroy_obj_rewriter()
+ipfw_destroy_obj_rewriter(void)
{
if (ctl3_rewriters != NULL)