From: "flichtenheld (Code Review)" Date: Wed, 19 Jun 2024 11:02:59 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <9f344a39d07987d5f25eba2383a618db5ba56509-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="Ll9lW2zdfaw="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: configure: Add -Wstrict-prototypes and -Wold-style-definition List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --Ll9lW2zdfaw= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/667?usp=3Demail to review the following change. Change subject: configure: Add -Wstrict-prototypes and -Wold-style-definiti= on ...................................................................... configure: Add -Wstrict-prototypes and -Wold-style-definition These are not covered by -Wall (nor -Wextra) but we want to enforce them. Change-Id: I6e08920e4cf4762b9f14a7461a29fa77df15255c Signed-off-by: Frank Lichtenheld --- M configure.ac M src/openvpn/dco.h M src/openvpn/dco_linux.c M src/openvpn/sig.c M src/openvpn/ssl.c M src/openvpn/ssl.h M src/openvpn/xkey_helper.c M src/openvpn/xkey_provider.c 8 files changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/67/667/1 diff --git a/configure.ac b/configure.ac index 2e5ab6a..c01ad09 100644 --- a/configure.ac +++ b/configure.ac @@ -1408,6 +1408,8 @@ ) ACL_CHECK_ADD_COMPILE_FLAGS([-Wno-stringop-truncation]) +ACL_CHECK_ADD_COMPILE_FLAGS([-Wstrict-prototypes]) +ACL_CHECK_ADD_COMPILE_FLAGS([-Wold-style-definition]) ACL_CHECK_ADD_COMPILE_FLAGS([-Wall]) if test "${enable_pedantic}" =3D "yes"; then diff --git a/src/openvpn/dco.h b/src/openvpn/dco.h index 50ebb35..cb0adcd 100644 --- a/src/openvpn/dco.h +++ b/src/openvpn/dco.h @@ -247,7 +247,7 @@ * * @return list of colon-separated ciphers */ -const char *dco_get_supported_ciphers(); +const char *dco_get_supported_ciphers(void); #else /* if defined(ENABLE_DCO) */ diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c index b2584b9..277cd64 100644 --- a/src/openvpn/dco_linux.c +++ b/src/openvpn/dco_linux.c @@ -1053,7 +1053,7 @@ } const char * -dco_get_supported_ciphers() +dco_get_supported_ciphers(void) { return "AES-128-GCM:AES-256-GCM:AES-192-GCM:CHACHA20-POLY1305"; } diff --git a/src/openvpn/sig.c b/src/openvpn/sig.c index cfbd942..8323f0d 100644 --- a/src/openvpn/sig.c +++ b/src/openvpn/sig.c @@ -448,7 +448,7 @@ } void -halt_low_priority_signals() +halt_low_priority_signals(void) { #ifndef _WIN32 struct sigaction sa; diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 2054eb4..17078c9 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -277,7 +277,7 @@ #endif void -enable_auth_user_pass() +enable_auth_user_pass(void) { auth_user_pass_enabled =3D true; } diff --git a/src/openvpn/ssl.h b/src/openvpn/ssl.h index 98e59e8..0e2a43f 100644 --- a/src/openvpn/ssl.h +++ b/src/openvpn/ssl.h @@ -381,7 +381,7 @@ void pem_password_setup(const char *auth_file); /* Enables the use of user/password authentication */ -void enable_auth_user_pass(); +void enable_auth_user_pass(void); /* * Setup authentication username and password. If auth_file is given, use = the diff --git a/src/openvpn/xkey_helper.c b/src/openvpn/xkey_helper.c index 283c95d..b68fb43 100644 --- a/src/openvpn/xkey_helper.c +++ b/src/openvpn/xkey_helper.c @@ -49,7 +49,7 @@ XKEY_EXTERNAL_SIGN_fn xkey_management_sign; static void -print_openssl_errors() +print_openssl_errors(void) { unsigned long e; while ((e =3D ERR_get_error())) diff --git a/src/openvpn/xkey_provider.c b/src/openvpn/xkey_provider.c index f5fc956..964d2eb 100644 --- a/src/openvpn/xkey_provider.c +++ b/src/openvpn/xkey_provider.c @@ -155,7 +155,7 @@ keymgmt_import_helper(XKEY_KEYDATA *key, const OSSL_PARAM params[]); static XKEY_KEYDATA * -keydata_new() +keydata_new(void) { xkey_dmsg(D_XKEY, "entry"); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/667?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I6e08920e4cf4762b9f14a7461a29fa77df15255c Gerrit-Change-Number: 667 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --Ll9lW2zdfaw= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

Vi= ew Change

configure: Add -Wstrict-prototypes and -Wold-style-definition=


These are not covered by -Wall (nor -Wextra) but we want
to enfo= rce them.

Change-Id: I6e08920e4cf4762b9f14a7461a29fa77df15255c
Si= gned-off-by: Frank Lichtenheld <frank@...2641...>
---
M configu= re.ac
M src/openvpn/dco.h
M src/openvpn/dco_linux.c
M src/openvpn/= sig.c
M src/openvpn/ssl.c
M src/openvpn/ssl.h
M src/openvpn/xkey_h= elper.c
M src/openvpn/xkey_provider.c
8 files changed, 9 insertions(+= ), 7 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn=
 refs/changes/67/667/1
diff --git a/configure.ac b/configure.ac
index 2e5ab6a..c01ad09 100644
--- a/configure.= ac
+++ b/configure.ac
@@ -1408,6 +1408,8 @@=
)

ACL_CHECK_ADD_COMPIL= E_FLAGS([-Wno-stringop-truncation])
+ACL_CHECK_ADD_COMPILE_FLAGS([-Wstrict-prototypes])+ACL_CHECK_ADD_COMPILE_FLAGS(= [-Wold-style-definition])
ACL_CHECK_ADD_COMPILE_FLAGS([-Wa= ll])

if test "${enable_pedantic}&qu= ot; =3D "yes"; then
diff --git a/src/openvpn/dco.= h b/src/openvpn/dco.h
index 50ebb35..cb0adcd 100644<= br>--- a/src/openvpn/dco.h
+++ b/src/openvpn/dco.h
@@ -247,7 +247,7 @@
*
* @= return list of colon-separated ciphers
= */
-const char *dco_get= _supported_ciphers();
+const char *dco_get_supported_ciphers(void);

= #else /* if defined(ENABLE_DCO) */

diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c

<= span>index b2584b9..277cd64 100644

--- a/src/openvpn/dco_li= nux.c
+++ b/src/openvpn/dco_linux.c
@@ -105= 3,7 +1053,7 @@
}

const = char *
-dco_get_support= ed_ciphers()
+dco_get= _supported_ciphers(void)
{
return &qu= ot;AES-128-GCM:AES-256-GCM:AES-192-GCM:CHACHA20-POLY1305";
<= span> }
diff --git a/src/openvpn/sig.c b/src/openvpn/sig.c<= /span>
index cfbd942..8323f0d 100644
--- a/src/ope= nvpn/sig.c
+++ b/src/openvpn/sig.c
@@ -448,= 7 +448,7 @@
}

void
-halt_low_priority_signals(= )
+halt_low_priority_= signals(void)
{
#ifndef _WIN32
= struct sigaction sa;
diff --git a/src/openvpn/ss= l.c b/src/openvpn/ssl.c
index 2054eb4..17078c9 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c<= /span>
@@ -277,7 +277,7 @@
#endif

void
+enable_auth_user_pass(void)
{
= auth_user_pass_enabled =3D true;
}
diff --= git a/src/openvpn/ssl.h b/src/openvpn/ssl.h
index 98e59e8..= 0e2a43f 100644
--- a/src/openvpn/ssl.h
+++ = b/src/openvpn/ssl.h
@@ -381,7 +381,7 @@
vo= id pem_password_setup(const char *auth_file);

<= span> /* Enables the use of user/password authentication */

-void enable_auth_user_pass();
<= br>+void enable_auth_user_pass(= void);

/*
* Setup auth= entication username and password. If auth_file is given, use the
= diff --git a/src/openvpn/xkey_helper.c b/src/openvpn/xkey_helper.c
index 283c95d..b68fb43 100644
--- a/src/openv= pn/xkey_helper.c
+++ b/src/openvpn/xkey_helper.c
= @@ -49,7 +49,7 @@
XKEY_EXTERNAL_SIGN_fn xkey_managem= ent_sign;

static void
-print_openssl_errors()
+print_openssl_errors(void)
= {
unsigned long e;
while (= (e =3D ERR_get_error()))
diff --git a/src/openvpn/xkey_prov= ider.c b/src/openvpn/xkey_provider.c
index f5fc956..964d2eb= 100644
--- a/src/openvpn/xkey_provider.c
+= ++ b/src/openvpn/xkey_provider.c
@@ -155,7 +155,7 @@=
keymgmt_import_helper(XKEY_KEYDATA *key, const OSSL_PARAM params= []);

static XKEY_KEYDATA *
-keydata_new()

+keydata_new(void)
{
xkey_dmsg(D_XKEY, "entry");


To view, visit change 667. To unsubscribe, or = for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6e08920e4cf4762b9f14a7461a2= 9fa77df15255c
Gerrit-Change-Number: 667
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-MessageType: newchange
--Ll9lW2zdfaw=--