From: "cron2 (Code Review)" Date: Thu, 20 Jun 2024 15:21:04 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="wg48wb3rx4o="; 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: flichtenheld , plaisthos Cc: openvpn-devel --wg48wb3rx4o= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#5) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/667?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 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 Acked-by: Gert Doering Message-Id: <20240620144230.19586-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28= 823.html Signed-off-by: Gert Doering --- M configure.ac M src/openvpn/dco.h M src/openvpn/dco_freebsd.c M src/openvpn/dco_linux.c M src/openvpn/pkcs11.h 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 M tests/unit_tests/openvpn/test_common.h M tests/unit_tests/openvpn/test_pkcs11.c M tests/unit_tests/openvpn/test_provider.c M tests/unit_tests/openvpn/test_ssl.c M tests/unit_tests/plugins/auth-pam/test_search_and_replace.c 15 files changed, 25 insertions(+), 23 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/67/667/5 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..035474f 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) */ @@ -375,7 +375,7 @@ } static inline const char * -dco_get_supported_ciphers() +dco_get_supported_ciphers(void) { return ""; } diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index 7c8b29c..9a90f5c 100644 --- a/src/openvpn/dco_freebsd.c +++ b/src/openvpn/dco_freebsd.c @@ -773,7 +773,7 @@ } const char * -dco_get_supported_ciphers() +dco_get_supported_ciphers(void) { return "none:AES-256-GCM:AES-192-GCM:AES-128-GCM:CHACHA20-POLY1305"; } 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/pkcs11.h b/src/openvpn/pkcs11.h index 3caedc0..772fa4e 100644 --- a/src/openvpn/pkcs11.h +++ b/src/openvpn/pkcs11.h @@ -35,7 +35,7 @@ ); void -pkcs11_terminate(); +pkcs11_terminate(void); bool pkcs11_addProvider( @@ -46,10 +46,10 @@ ); int -pkcs11_logout(); +pkcs11_logout(void); int -pkcs11_management_id_count(); +pkcs11_management_id_count(void); bool pkcs11_management_id_get( 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"); diff --git a/tests/unit_tests/openvpn/test_common.h b/tests/unit_tests/open= vpn/test_common.h index f219e93..52503c6 100644 --- a/tests/unit_tests/openvpn/test_common.h +++ b/tests/unit_tests/openvpn/test_common.h @@ -33,7 +33,7 @@ * methods */ static inline void -openvpn_unit_test_setup() +openvpn_unit_test_setup(void) { assert_int_equal(setvbuf(stdout, NULL, _IONBF, BUFSIZ), 0); assert_int_equal(setvbuf(stderr, NULL, _IONBF, BUFSIZ), 0); diff --git a/tests/unit_tests/openvpn/test_pkcs11.c b/tests/unit_tests/open= vpn/test_pkcs11.c index 84ebb29..6d283a2 100644 --- a/tests/unit_tests/openvpn/test_pkcs11.c +++ b/tests/unit_tests/openvpn/test_pkcs11.c @@ -134,7 +134,7 @@ /* Fill-in certs[] array */ void -init_cert_data() +init_cert_data(void) { struct test_cert certs_local[] =3D { {cert1, key1, cname1, "OVPN TEST CA1", "OVPN Test Cert 1", {0= }, NULL}, diff --git a/tests/unit_tests/openvpn/test_provider.c b/tests/unit_tests/op= envpn/test_provider.c index 934b2d3..cfe9ac3 100644 --- a/tests/unit_tests/openvpn/test_provider.c +++ b/tests/unit_tests/openvpn/test_provider.c @@ -119,7 +119,7 @@ } static void -init_test() +init_test(void) { openvpn_unit_test_setup(); prov[0] =3D OSSL_PROVIDER_load(NULL, "default"); @@ -135,7 +135,7 @@ } static void -uninit_test() +uninit_test(void) { for (size_t i =3D 0; i < _countof(prov); i++) { diff --git a/tests/unit_tests/openvpn/test_ssl.c b/tests/unit_tests/openvpn= /test_ssl.c index a9a3137..5da5b1c 100644 --- a/tests/unit_tests/openvpn/test_ssl.c +++ b/tests/unit_tests/openvpn/test_ssl.c @@ -81,7 +81,7 @@ "-----END CERTIFICATE-----\n"; static const char * -get_tmp_dir() +get_tmp_dir(void) { const char *ret; #ifdef _WIN32 diff --git a/tests/unit_tests/plugins/auth-pam/test_search_and_replace.c b/= tests/unit_tests/plugins/auth-pam/test_search_and_replace.c index ee7a151..d40467f 100644 --- a/tests/unit_tests/plugins/auth-pam/test_search_and_replace.c +++ b/tests/unit_tests/plugins/auth-pam/test_search_and_replace.c @@ -9,7 +9,7 @@ #include "utils.h" static void -pass_any_null_param__returns_null() +pass_any_null_param__returns_null(void **state) { char DUMMY[] =3D "DUMMY"; @@ -20,7 +20,7 @@ } static void -pass_any_empty_string__returns_null() +pass_any_empty_string__returns_null(void **state) { char DUMMY[] =3D "DUMMY"; @@ -32,7 +32,7 @@ } static void -replace_single_char__one_time__match_is_replaced() +replace_single_char__one_time__match_is_replaced(void **state) { char *replaced =3D searchandreplace("X", "X", "Y"); @@ -43,7 +43,7 @@ } static void -replace_single_char__multiple_times__match_all_matches_are_replaced() +replace_single_char__multiple_times__match_all_matches_are_replaced(void *= *state) { char *replaced =3D searchandreplace("XaX", "X", "Y"); @@ -54,7 +54,7 @@ } static void -replace_longer_text__multiple_times__match_all_matches_are_replaced() +replace_longer_text__multiple_times__match_all_matches_are_replaced(void *= *state) { char *replaced =3D searchandreplace("XXaXX", "XX", "YY"); @@ -65,7 +65,7 @@ } static void -pattern_not_found__returns_original() +pattern_not_found__returns_original(void **state) { char *replaced =3D searchandreplace("abc", "X", "Y"); -- 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: 5 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --wg48wb3rx4o= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #5 to the change originally cr= eated by flichtenheld.

View Change

The following approvals got outda= ted and were removed: Code-Review+2 by cron2

configure: Add -Wstrict-prototypes and -Wold-style-d=
efinition

These are not covered by -Wall (nor -Wextra) but we wantto enforce them.

Change-Id: I6e08920e4cf4762b9f14a7461a29fa77df152= 55c
Signed-off-by: Frank Lichtenheld <frank@...2641...>
Acked-b= y: Gert Doering <gert@...1296...>
Message-Id: <20240620144230.1= 9586-1-gert@...1296...>
URL: https://www.mail-archive.com/openvpn-dev= el@lists.sourceforge.net/msg28823.html
Signed-off-by: Gert Doering <g= ert@...1296...>
---
M configure.ac
M src/openvpn/dco.h
M src= /openvpn/dco_freebsd.c
M src/openvpn/dco_linux.c
M src/openvpn/pkcs11= .h
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
M tests/uni= t_tests/openvpn/test_common.h
M tests/unit_tests/openvpn/test_pkcs11.cM tests/unit_tests/openvpn/test_provider.c
M tests/unit_tests/openvpn/= test_ssl.c
M tests/unit_tests/plugins/auth-pam/test_search_and_replace.c=
15 files changed, 25 insertions(+), 23 deletions(-)

git pull =
ssh://gerrit.openvpn.net:29418/openvpn refs/changes/67/667/5
diff -=
-git a/configure.ac b/configure.ac
index 2e5ab6a..c01ad09 1= 00644
--- 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])
<= span> ACL_CHECK_ADD_COMPILE_FLAGS([-Wall])


if test "${enable_pedantic}" =3D "yes"; then<= br>diff --git a/src/openvpn/dco.h b/src/openvpn/dco.h
index 50ebb35..035474f 100644
--- a/src/openvpn/dco.h

+++ b/src/openvpn/dco.h
@@ -247,7 +247,7 @@
*
* @return list of colo= n-separated ciphers
*/
-const char *dco_get_supported_ciphers();
+const char *dco_get_supported_ciphe= rs(void);


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

@@ -375,7 +375,7 @@
= }

static inline const char *
= -dco_get_supported_ciphers()
+dco_get_supported_cipher= s(void)
{
return "";=
}
diff --git a/src/openvpn/dco_freebsd.c b/src/o= penvpn/dco_freebsd.c
index 7c8b29c..9a90f5c 100644--- a/src/openvpn/dco_freebsd.c
+++ b/src/openvpn/d= co_freebsd.c
@@ -773,7 +773,7 @@
}<= br>
const char *
-dco_get_supported_ciphers()
+dco_get_supported_ciphers(void)
= {
return "none:AES-256-GCM:AES-192-GCM:AES-128-G= CM:CHACHA20-POLY1305";
}
diff --git a= /src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c
index b2= 584b9..277cd64 100644
--- a/src/openvpn/dco_linux.c<= br>+++ b/src/openvpn/dco_linux.c
@@ -1053,7 +1053,7 @= @
}

const char *=
-dco_get_supported_ciphers()<= /span>
+dco_get_supported_ci= phers(void)
{
return "AES-128-GC= M:AES-256-GCM:AES-192-GCM:CHACHA20-POLY1305";
}
diff --git a/src/openvpn/pkcs11.h b/src/openvpn/pkcs11.h<= br>index 3caedc0..772fa4e 100644
--- a/src/openvpn/pk= cs11.h
+++ b/src/openvpn/pkcs11.h
@@ -35,7 = +35,7 @@
);

void
-pkcs11_terminate();
+pkcs11_terminate(void);<= /span>

bool
pkcs11_addProvider= (
@@ -46,10 +46,10 @@
);

int
-pkcs11_logout();
= +pkcs11_logout(void);

int
-pkcs11_management_id_count();
=
+pkcs11_management_id_count= (void);

bool
pkcs11_man= agement_id_get(
diff --git a/src/openvpn/sig.c b/src/openvp= n/sig.c
index cfbd942..8323f0d 100644
--- a= /src/openvpn/sig.c
+++ b/src/openvpn/sig.c
= @@ -448,7 +448,7 @@
}

v= oid
-halt_low_priority_= signals()
+halt_low_p= riority_signals(void)
{
#ifndef _WIN32
struct sigaction sa;
diff --git a/src/op= envpn/ssl.c b/src/openvpn/ssl.c
index 2054eb4..17078c9 1006= 44
--- a/src/openvpn/ssl.c
+++ b/src/openvp= n/ssl.c
@@ -277,7 +277,7 @@
#endif<= br>
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 9= 8e59e8..0e2a43f 100644
--- a/src/openvpn/ssl.h
+++ b/src/openvpn/ssl.h

@@ -381,7 +381,7 @@
<= span> void pem_password_setup(const char *auth_file);


/* Enables the use of user/password authentication */<= br>-void enable_auth_user_pass();=
+void enable_auth_us= er_pass(void);

/*
* Se= tup authentication username and password. If auth_file is given, use the
diff --git a/src/openvpn/xkey_helper.c b/src/openvpn/xkey_hel= per.c
index 283c95d..b68fb43 100644
--- a/s= rc/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/x= key_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_PARA= M params[]);

static XKEY_KEYDATA *
-keydata_new()
+keydata_new(void)

{

xkey_dmsg(D_XKEY, "entry");

diff --git a/tests/unit_tests/openvpn/test_common.h b= /tests/unit_tests/openvpn/test_common.h
index f219e93..5250= 3c6 100644
--- a/tests/unit_tests/openvpn/test_common.h
+++ b/tests/unit_tests/openvpn/test_common.h
@= @ -33,7 +33,7 @@
* methods
*/ static inline void
-openvpn_unit_test_setup()
+openvpn_unit_test_setup(void)
{
assert_int_equal(setvbuf(stdout, NULL, _IONBF, BUFSIZ), 0);
assert_int_equal(setvbuf(stderr, NULL, _IONBF, BUFSIZ), 0);
diff --git a/tests/unit_tests/openvpn/test_pkcs11.c b/tests/un= it_tests/openvpn/test_pkcs11.c
index 84ebb29..6d283a2 10064= 4
--- a/tests/unit_tests/openvpn/test_pkcs11.c
+++ b/tests/unit_tests/openvpn/test_pkcs11.c

@@ -134,7 = +134,7 @@

/* Fill-in certs[] array */
void
-in= it_cert_data()
+init_= cert_data(void)
{
struct test_cert ce= rts_local[] =3D {
{cert1, key1, cname1, "O= VPN TEST CA1", "OVPN Test Cert 1", {0}, NULL},
= diff --git a/tests/unit_tests/openvpn/test_provider.c b/tests/unit_te= sts/openvpn/test_provider.c
index 934b2d3..cfe9ac3 100644
--- a/tests/unit_tests/openvpn/test_provider.c
+++ b/tests/unit_tests/openvpn/test_provider.c

@@ -119,7= +119,7 @@
}

static voi= d
-init_test()+init_test(void)
{

openvpn_unit_test_setup();
= prov[0] =3D OSSL_PROVIDER_load(NULL, "default");
@@ -135,7 +135,7 @@

}

= static void
-uninit_tes= t()
+uninit_test(void= )
{
for (size_t i =3D 0; i < _coun= tof(prov); i++)
{
diff --git a/tests/u= nit_tests/openvpn/test_ssl.c b/tests/unit_tests/openvpn/test_ssl.cindex a9a3137..5da5b1c 100644
--- a/tests/unit_test= s/openvpn/test_ssl.c
+++ b/tests/unit_tests/openvpn/test_ss= l.c
@@ -81,7 +81,7 @@
= "-----END CERTIFICATE-----\n";
static const char *
-get_tmp_dir()
= +get_tmp_dir(void)
{
const char *ret;=
#ifdef _WIN32
diff --git a/tests/unit_tes= ts/plugins/auth-pam/test_search_and_replace.c b/tests/unit_tests/plugins/au= th-pam/test_search_and_replace.c
index ee7a151..d40467f 100= 644
--- a/tests/unit_tests/plugins/auth-pam/test_search_and= _replace.c
+++ b/tests/unit_tests/plugins/auth-pam/test_sea= rch_and_replace.c
@@ -9,7 +9,7 @@
#include= "utils.h"

static void<= br>-pass_any_null_param__returns_= null()
+pass_any_null= _param__returns_null(void **state)
{

char DUMMY[] =3D "DUMMY";
@@ -2= 0,7 +20,7 @@
}

static v= oid
-pass_any_empty_str= ing__returns_null()
+= pass_any_empty_string__returns_null(void **state)
{=

char DUMMY[] =3D "DUMMY";=
@@ -32,7 +32,7 @@
}

= static void
-rep= lace_single_char__one_time__match_is_replaced()
+replace_single_char__one_time__match_is_replace= d(void **state)
{
char *replaced =3D = searchandreplace("X", "X", "Y");

@@ -43,7 +43,7 @@
}
=
static void
-replace_single_char__multiple_times__match_all_matches_are_replace= d()
+replace_single_c= har__multiple_times__match_all_matches_are_replaced(void **state) {
char *replaced =3D searchandreplace("Xa= X", "X", "Y");

@= @ -54,7 +54,7 @@
}

stat= ic void
-replace_longer= _text__multiple_times__match_all_matches_are_replaced()
+replace_longer_text__multiple_times__ma= tch_all_matches_are_replaced(void **state)
{
char *replaced =3D searchandreplace("XXaXX", "XX&quo= t;, "YY");


@@ -65,7 +65,7 @@
}

static void
<= span style=3D"color: hsl(0, 100%, 40%);">-pattern_not_found__returns_origin= al()

+pattern_not_fou= nd__returns_original(void **state)
{
= char *replaced =3D searchandreplace("abc", "X", "Y= ");


To view, vis= it 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: 5
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--wg48wb3rx4o=--