]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
configure: Add -Wstrict-prototypes and -Wold-style-definition
authorFrank Lichtenheld <frank@lichtenheld.com>
Thu, 20 Jun 2024 14:42:30 +0000 (16:42 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 20 Jun 2024 15:01:31 +0000 (17:01 +0200)
These are not covered by -Wall (nor -Wextra) but we want
to enforce them.

Change-Id: I6e08920e4cf4762b9f14a7461a29fa77df15255c
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20240620144230.19586-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28823.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
15 files changed:
configure.ac
src/openvpn/dco.h
src/openvpn/dco_freebsd.c
src/openvpn/dco_linux.c
src/openvpn/pkcs11.h
src/openvpn/sig.c
src/openvpn/ssl.c
src/openvpn/ssl.h
src/openvpn/xkey_helper.c
src/openvpn/xkey_provider.c
tests/unit_tests/openvpn/test_common.h
tests/unit_tests/openvpn/test_pkcs11.c
tests/unit_tests/openvpn/test_provider.c
tests/unit_tests/openvpn/test_ssl.c
tests/unit_tests/plugins/auth-pam/test_search_and_replace.c

index 2e5ab6a65eb25f79198bc4597fc33bbd0fd4e111..c01ad093d1c9ea0354d6d90c5284acec0ce8964f 100644 (file)
@@ -1408,6 +1408,8 @@ AC_DEFUN([ACL_CHECK_ADD_COMPILE_FLAGS], [
 )
 
 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}" = "yes"; then
index 50ebb3591fa5e7c9c02e8da41ef16819feb3ad49..035474fca09719042c8729c6f3b80d21e1d0220b 100644 (file)
@@ -247,7 +247,7 @@ int dco_get_peer_stats(struct context *c);
  *
  * @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 @@ dco_get_peer_stats(struct context *c)
 }
 
 static inline const char *
-dco_get_supported_ciphers()
+dco_get_supported_ciphers(void)
 {
     return "";
 }
index 7c8b29c9b480dea976944457323983e2afb1a173..9a90f5c0b37c6128e3127ad986afd85214e55b5e 100644 (file)
@@ -773,7 +773,7 @@ dco_get_peer_stats(struct context *c)
 }
 
 const char *
-dco_get_supported_ciphers()
+dco_get_supported_ciphers(void)
 {
     return "none:AES-256-GCM:AES-192-GCM:AES-128-GCM:CHACHA20-POLY1305";
 }
index b2584b973ce3659c81a18a252e4be4645a5d6f6e..277cd644d5b26a791a35f84e17f13fdc93f6ee50 100644 (file)
@@ -1053,7 +1053,7 @@ dco_event_set(dco_context_t *dco, struct event_set *es, void *arg)
 }
 
 const char *
-dco_get_supported_ciphers()
+dco_get_supported_ciphers(void)
 {
     return "AES-128-GCM:AES-256-GCM:AES-192-GCM:CHACHA20-POLY1305";
 }
index 3caedc00ef494abe4a5fa7b4b6a9a2533da8d3f7..772fa4ed7832d815cf74fb5a4f590b6d7f0edf31 100644 (file)
@@ -35,7 +35,7 @@ pkcs11_initialize(
     );
 
 void
-pkcs11_terminate();
+pkcs11_terminate(void);
 
 bool
 pkcs11_addProvider(
@@ -46,10 +46,10 @@ pkcs11_addProvider(
     );
 
 int
-pkcs11_logout();
+pkcs11_logout(void);
 
 int
-pkcs11_management_id_count();
+pkcs11_management_id_count(void);
 
 bool
 pkcs11_management_id_get(
index cfbd942b81f77d37eaa2c0b90df9b623aa9aea7d..8323f0d97f2141693b6703ab1b0636ea25eadc84 100644 (file)
@@ -448,7 +448,7 @@ post_init_signal_catch(void)
 }
 
 void
-halt_low_priority_signals()
+halt_low_priority_signals(void)
 {
 #ifndef _WIN32
     struct sigaction sa;
index 2054eb474e0635e939c31cc06d81ccb374e835e2..17078c9930d03fb0c5d54d783c1be8e5de042fa5 100644 (file)
@@ -277,7 +277,7 @@ static char *auth_challenge; /* GLOBAL */
 #endif
 
 void
-enable_auth_user_pass()
+enable_auth_user_pass(void)
 {
     auth_user_pass_enabled = true;
 }
index 98e59e886f81cd27c27f945cd384174eec15f810..0e2a43f8eb0db08644f6f905f5f9b8e759674269 100644 (file)
@@ -381,7 +381,7 @@ void tls_post_encrypt(struct tls_multi *multi, struct buffer *buf);
 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
index 283c95dbc8c1226ac1519c8bb70b1e22ab37613e..b68fb434de2a89b79166e7a77670f856fa3ea73a 100644 (file)
@@ -49,7 +49,7 @@ static const char *const props = XKEY_PROV_PROPS;
 XKEY_EXTERNAL_SIGN_fn xkey_management_sign;
 
 static void
-print_openssl_errors()
+print_openssl_errors(void)
 {
     unsigned long e;
     while ((e = ERR_get_error()))
index f5fc9568a4c340a7e1ae0c87b2188f623cbb8a22..964d2eb1c092b607b90460ab17ab347225106fa9 100644 (file)
@@ -155,7 +155,7 @@ static int
 keymgmt_import_helper(XKEY_KEYDATA *key, const OSSL_PARAM params[]);
 
 static XKEY_KEYDATA *
-keydata_new()
+keydata_new(void)
 {
     xkey_dmsg(D_XKEY, "entry");
 
index f219e93e9a080686b5af065f7cbdf31fb0a1eae7..52503c662260f4080cf6de76d94cf162fe34954c 100644 (file)
@@ -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);
index 84ebb292e33577de942213a310591b1c3c6788fb..6d283a209b03921ae2fe87e0e3935c0e3435d1bd 100644 (file)
@@ -134,7 +134,7 @@ struct env_set *es;
 
 /* Fill-in certs[] array */
 void
-init_cert_data()
+init_cert_data(void)
 {
     struct test_cert certs_local[] = {
         {cert1,  key1,  cname1,  "OVPN TEST CA1",  "OVPN Test Cert 1",  {0},  NULL},
index 934b2d3b048d0691e1ce3c72d42b1002cccbcdf4..cfe9ac32f9db8c5c37cdae254122b0ec05cb4344 100644 (file)
@@ -119,7 +119,7 @@ load_pubkey(const char *pem)
 }
 
 static void
-init_test()
+init_test(void)
 {
     openvpn_unit_test_setup();
     prov[0] = OSSL_PROVIDER_load(NULL, "default");
@@ -135,7 +135,7 @@ init_test()
 }
 
 static void
-uninit_test()
+uninit_test(void)
 {
     for (size_t i = 0; i < _countof(prov); i++)
     {
index a9a31379ceb8751c26808f8be0c5a293f55aec72..5da5b1c2a7980fba96b2411af89cad7f0a3a7047 100644 (file)
@@ -81,7 +81,7 @@ const char *unittest_cert = "-----BEGIN CERTIFICATE-----\n"
                             "-----END CERTIFICATE-----\n";
 
 static const char *
-get_tmp_dir()
+get_tmp_dir(void)
 {
     const char *ret;
 #ifdef _WIN32
index ee7a15182ce7a772eafbcc2d8269e0682a332fe9..d40467f2143d549b63d8f94d753cc90bb745559e 100644 (file)
@@ -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[] = "DUMMY";
@@ -20,7 +20,7 @@ pass_any_null_param__returns_null()
 }
 
 static void
-pass_any_empty_string__returns_null()
+pass_any_empty_string__returns_null(void **state)
 {
 
     char DUMMY[] = "DUMMY";
@@ -32,7 +32,7 @@ pass_any_empty_string__returns_null()
 }
 
 static void
-replace_single_char__one_time__match_is_replaced()
+replace_single_char__one_time__match_is_replaced(void **state)
 {
     char *replaced = searchandreplace("X", "X", "Y");
 
@@ -43,7 +43,7 @@ replace_single_char__one_time__match_is_replaced()
 }
 
 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 = searchandreplace("XaX", "X", "Y");
 
@@ -54,7 +54,7 @@ replace_single_char__multiple_times__match_all_matches_are_replaced()
 }
 
 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 = searchandreplace("XXaXX", "XX", "YY");
 
@@ -65,7 +65,7 @@ replace_longer_text__multiple_times__match_all_matches_are_replaced()
 }
 
 static void
-pattern_not_found__returns_original()
+pattern_not_found__returns_original(void **state)
 {
     char *replaced = searchandreplace("abc", "X", "Y");