Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jul 2022 18:48:20 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: a9aa00437bd8 - stable/12 - Adjust function definitions in if_pfsync.c to avoid clang 15 warnings
Message-ID:  <202207291848.26TImKv5025249@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=a9aa00437bd89b8d4e8d24afdd32f8553b5e38ed

commit a9aa00437bd89b8d4e8d24afdd32f8553b5e38ed
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-25 18:53:32 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-29 18:35:36 +0000

    Adjust function definitions in if_pfsync.c to avoid clang 15 warnings
    
    With clang 15, the following -Werror warnings are produced:
    
        sys/netpfil/pf/if_pfsync.c:2439:21: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        pfsync_pointers_init()
                            ^
                             void
        sys/netpfil/pf/if_pfsync.c:2453:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        pfsync_pointers_uninit()
                              ^
                               void
        sys/netpfil/pf/if_pfsync.c:2503:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        pfsync_init()
                   ^
                    void
        sys/netpfil/pf/if_pfsync.c:2524:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        pfsync_uninit()
                     ^
                      void
    
    This is because pfsync_pointers_init(), pfsync_pointers_uninit(),
    pfsync_init(), and pfsync_uninit() are declared with (void) argument
    lists, but defined with empty argument lists. Make the definitions match
    the declarations.
    
    MFC after:      3 days
    
    (cherry picked from commit 766f3c8032a95f344823bea70bb7f794f9939d33)
---
 sys/netpfil/pf/if_pfsync.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c
index da1d17452cb0..88b85398db58 100644
--- a/sys/netpfil/pf/if_pfsync.c
+++ b/sys/netpfil/pf/if_pfsync.c
@@ -2433,7 +2433,7 @@ static struct protosw in_pfsync_protosw = {
 #endif
 
 static void
-pfsync_pointers_init()
+pfsync_pointers_init(void)
 {
 
 	PF_RULES_WLOCK();
@@ -2447,7 +2447,7 @@ pfsync_pointers_init()
 }
 
 static void
-pfsync_pointers_uninit()
+pfsync_pointers_uninit(void)
 {
 
 	PF_RULES_WLOCK();
@@ -2497,7 +2497,7 @@ VNET_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_FOURTH,
     vnet_pfsync_uninit, NULL);
 
 static int
-pfsync_init()
+pfsync_init(void)
 {
 #ifdef INET
 	int error;
@@ -2518,7 +2518,7 @@ pfsync_init()
 }
 
 static void
-pfsync_uninit()
+pfsync_uninit(void)
 {
 	pfsync_detach_ifnet_ptr = NULL;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207291848.26TImKv5025249>