Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jul 2022 18:47:10 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: 2ec39d95e76b - stable/13 - Adjust function definitions in pf.c to avoid clang 15 warnings
Message-ID:  <202207291847.26TIlAT3023739@gitrepo.freebsd.org>

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

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

commit 2ec39d95e76bf1cf994a4b9a8173752def211673
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-25 17:59:59 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-29 18:28:07 +0000

    Adjust function definitions in pf.c to avoid clang 15 warnings
    
    With clang 15, the following -Werror warnings are produced:
    
        sys/netpfil/pf/pf.c:985:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        pf_mtag_initialize()
                          ^
                           void
        sys/netpfil/pf/pf.c:995:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        pf_initialize()
                     ^
                      void
        sys/netpfil/pf/pf.c:1089:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        pf_mtag_cleanup()
                       ^
                        void
        sys/netpfil/pf/pf.c:1096:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        pf_cleanup()
                  ^
                   void
        sys/netpfil/pf/pf.c:1989:27: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        pf_purge_expired_src_nodes()
                                  ^
                                   void
        sys/netpfil/pf/pf.c:2174:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        pf_purge_unlinked_rules()
                               ^
                                void
    
    This is because pf_mtag_initialize(), pf_initialize(),
    pf_mtag_cleanup(), pf_cleanup(), pf_purge_expired_src_nodes(), and
    pf_purge_unlinked_rules() 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 503b5870c018ec342be1396896560b720945d7e5)
---
 sys/netpfil/pf/pf.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 0c5266fbbcb9..d6c6a624d12b 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -922,7 +922,7 @@ pf_free_src_nodes(struct pf_ksrc_node_list *head)
 }
 
 void
-pf_mtag_initialize()
+pf_mtag_initialize(void)
 {
 
 	pf_mtag_z = uma_zcreate("pf mtags", sizeof(struct m_tag) +
@@ -932,7 +932,7 @@ pf_mtag_initialize()
 
 /* Per-vnet data storage structures initialization. */
 void
-pf_initialize()
+pf_initialize(void)
 {
 	struct pf_keyhash	*kh;
 	struct pf_idhash	*ih;
@@ -1026,14 +1026,14 @@ pf_initialize()
 }
 
 void
-pf_mtag_cleanup()
+pf_mtag_cleanup(void)
 {
 
 	uma_zdestroy(pf_mtag_z);
 }
 
 void
-pf_cleanup()
+pf_cleanup(void)
 {
 	struct pf_keyhash	*kh;
 	struct pf_idhash	*ih;
@@ -1920,7 +1920,7 @@ pf_state_expires(const struct pf_kstate *state)
 }
 
 void
-pf_purge_expired_src_nodes()
+pf_purge_expired_src_nodes(void)
 {
 	struct pf_ksrc_node_list	 freelist;
 	struct pf_srchash	*sh;
@@ -2108,7 +2108,7 @@ relock:
 }
 
 static void
-pf_purge_unlinked_rules()
+pf_purge_unlinked_rules(void)
 {
 	struct pf_krulequeue tmpq;
 	struct pf_krule *r, *r1;



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