From: "flichtenheld (Code Review)" Date: Tue, 14 Jan 2025 13:14:13 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <3dd4f4c4f8c718798acd83a4828c4db01ea68bd1-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="fnUNggnkaQU="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: Fix various compiler warnings for intentionally unused parameters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --fnUNggnkaQU= 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/+/861?usp=3Demail to review the following change. Change subject: Fix various compiler warnings for intentionally unused para= meters ...................................................................... Fix various compiler warnings for intentionally unused parameters Change-Id: I1146da697adb8a200df0507dc7ec931c36738ffa Signed-off-by: Frank Lichtenheld --- M src/openvpn/dco_win.h M src/openvpn/event.h M src/openvpn/multi.c M src/openvpn/perf.h M src/openvpn/route.c M src/openvpn/route.h M src/openvpn/ssl.c M src/openvpn/tun.h M src/openvpn/xkey_provider.c M src/plugins/auth-pam/auth-pam.c M src/plugins/down-root/down-root.c 11 files changed, 30 insertions(+), 30 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/61/861/1 diff --git a/src/openvpn/dco_win.h b/src/openvpn/dco_win.h index 7688516..99c9252 100644 --- a/src/openvpn/dco_win.h +++ b/src/openvpn/dco_win.h @@ -54,7 +54,7 @@ #else /* if defined(ENABLE_DCO) && defined(_WIN32) */ static inline void -dco_start_tun(struct tuntap *tt) +dco_start_tun(struct tuntap *) { ASSERT(false); } diff --git a/src/openvpn/event.h b/src/openvpn/event.h index c212e07..d792145 100644 --- a/src/openvpn/event.h +++ b/src/openvpn/event.h @@ -214,7 +214,7 @@ #else /* ifdef _WIN32 */ static inline void -wait_signal(struct event_set *es, void *arg) +wait_signal(struct event_set *, void *) { } diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index f426b46..7fa3b43 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -252,7 +252,7 @@ #ifdef ENABLE_MANAGEMENT static uint32_t -cid_hash_function(const void *key, uint32_t iv) +cid_hash_function(const void *key, uint32_t /*iv*/) { const unsigned long *k =3D (const unsigned long *)key; return (uint32_t) *k; @@ -273,7 +273,7 @@ /* * inotify watcher descriptors are used as hash value */ -int_hash_function(const void *key, uint32_t iv) +int_hash_function(const void *key, uint32_t /*iv*/) { return (unsigned long)key; } diff --git a/src/openvpn/perf.h b/src/openvpn/perf.h index 04abe89..d394347 100644 --- a/src/openvpn/perf.h +++ b/src/openvpn/perf.h @@ -75,7 +75,7 @@ #else /* ifdef ENABLE_PERFORMANCE_METRICS */ static inline void -perf_push(int type) +perf_push(int) { } static inline void diff --git a/src/openvpn/route.c b/src/openvpn/route.c index d17b285..2aa33d0 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -4181,7 +4181,7 @@ #else /* if defined(_WIN32) */ static void -get_bypass_addresses(struct route_bypass *rb, const unsigned int flags) = /* PLATFORM-SPECIFIC */ +get_bypass_addresses(struct route_bypass *, const unsigned int) /* PLATF= ORM-SPECIFIC */ { } diff --git a/src/openvpn/route.h b/src/openvpn/route.h index 421e7d2..e605d8b 100644 --- a/src/openvpn/route.h +++ b/src/openvpn/route.h @@ -365,7 +365,7 @@ #else /* ifdef _WIN32 */ static inline bool -test_routes(const struct route_list *rl, const struct tuntap *tt) +test_routes(const struct route_list *, const struct tuntap *) { return true; } diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index e4a7b57..631e547 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -257,7 +257,7 @@ } int -pem_password_callback(char *buf, int size, int rwflag, void *u) +pem_password_callback(char *buf, int size, int /*rwflag*/, void */*u*/) { if (buf) { diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h index ccba0bc..a5b9a48 100644 --- a/src/openvpn/tun.h +++ b/src/openvpn/tun.h @@ -698,37 +698,37 @@ #else /* ifdef _WIN32 */ static inline bool -tuntap_stop(int status) +tuntap_stop(int) { return false; } static inline bool -tuntap_abort(int status) +tuntap_abort(int) { return false; } static inline void -tun_standby_init(struct tuntap *tt) +tun_standby_init(struct tuntap *) { } static inline bool -tun_standby(struct tuntap *tt) +tun_standby(struct tuntap *) { return true; } static inline bool -tuntap_is_dco_win(struct tuntap *tt) +tuntap_is_dco_win(struct tuntap *) { return false; } static inline bool -tuntap_is_dco_win_timeout(struct tuntap *tt, int status) +tuntap_is_dco_win_timeout(struct tuntap *, int) { return false; } diff --git a/src/openvpn/xkey_provider.c b/src/openvpn/xkey_provider.c index 964d2eb..8efcd9e 100644 --- a/src/openvpn/xkey_provider.c +++ b/src/openvpn/xkey_provider.c @@ -204,7 +204,7 @@ } static void * -keymgmt_load(const void *reference, size_t reference_sz) +keymgmt_load(const void */*reference*/, size_t /*reference_sz*/) { xkey_dmsg(D_XKEY, "entry"); @@ -416,7 +416,7 @@ /* A minimal set of key params that we can return */ static const OSSL_PARAM * -keymgmt_gettable_params(void *provctx) +keymgmt_gettable_params(void */*provctx*/) { xkey_dmsg(D_XKEY, "entry"); @@ -558,7 +558,7 @@ } static const char * -rsa_keymgmt_name(int id) +rsa_keymgmt_name(int /*id*/) { xkey_dmsg(D_XKEY, "entry"); @@ -761,7 +761,7 @@ } static const OSSL_PARAM * -signature_settable_ctx_params(void *ctx, void *provctx) +signature_settable_ctx_params(void */*ctx*/, void */*provctx*/) { xkey_dmsg(D_XKEY, "entry"); @@ -874,7 +874,7 @@ } static const OSSL_PARAM * -signature_gettable_ctx_params(void *ctx, void *provctx) +signature_gettable_ctx_params(void */*ctx*/, void */*provctx*/) { xkey_dmsg(D_XKEY, "entry"); @@ -884,7 +884,7 @@ } static int -signature_get_ctx_params(void *ctx, OSSL_PARAM params[]) +signature_get_ctx_params(void */*ctx*/, OSSL_PARAM */*params[]*/) { xkey_dmsg(D_XKEY, "not implemented"); return 0; @@ -936,7 +936,7 @@ } static int -signature_sign(void *ctx, unsigned char *sig, size_t *siglen, size_t sigsi= ze, +signature_sign(void *ctx, unsigned char *sig, size_t *siglen, size_t /*sig= size*/, const unsigned char *tbs, size_t tbslen) { xkey_dmsg(D_XKEY, "entry with siglen =3D %zu\n", *siglen); @@ -956,8 +956,8 @@ } static int -signature_digest_verify_init(void *ctx, const char *mdname, void *provkey, - const OSSL_PARAM params[]) +signature_digest_verify_init(void */*ctx*/, const char *mdname, void */*pr= ovkey*/, + const OSSL_PARAM */*params[]*/) { xkey_dmsg(D_XKEY, "mdname <%s>", mdname); @@ -970,8 +970,8 @@ * for debugging purposes. */ static int -signature_digest_verify(void *ctx, const unsigned char *sig, size_t siglen, - const unsigned char *tbs, size_t tbslen) +signature_digest_verify(void */*ctx*/, const unsigned char */*sig*/, size_= t /*siglen*/, + const unsigned char */*tbs*/, size_t /*tbslen*/) { xkey_dmsg(D_XKEY, "entry"); @@ -1166,7 +1166,7 @@ static OSSL_FUNC_provider_teardown_fn teardown; static const OSSL_ALGORITHM * -query_operation(void *provctx, int op, int *no_store) +query_operation(void */*provctx*/, int op, int *no_store) { xkey_dmsg(D_XKEY, "op =3D %d", op); @@ -1188,7 +1188,7 @@ } static const OSSL_PARAM * -gettable_params(void *provctx) +gettable_params(void */*provctx*/) { xkey_dmsg(D_XKEY, "entry"); @@ -1200,7 +1200,7 @@ return param_types; } static int -get_params(void *provctx, OSSL_PARAM params[]) +get_params(void */*provctx*/, OSSL_PARAM params[]) { OSSL_PARAM *p; diff --git a/src/plugins/auth-pam/auth-pam.c b/src/plugins/auth-pam/auth-pa= m.c index 54cab33..7aa477c 100644 --- a/src/plugins/auth-pam/auth-pam.c +++ b/src/plugins/auth-pam/auth-pam.c @@ -520,7 +520,7 @@ } OPENVPN_EXPORT int -openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, const int type, con= st char *argv[], const char *envp[]) +openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, const int type, con= st char **/*argv[]*/, const char *envp[]) { struct auth_pam_context *context =3D (struct auth_pam_context *) handl= e; diff --git a/src/plugins/down-root/down-root.c b/src/plugins/down-root/down= -root.c index 384bc81..3a152b1 100644 --- a/src/plugins/down-root/down-root.c +++ b/src/plugins/down-root/down-root.c @@ -344,7 +344,7 @@ } OPENVPN_EXPORT int -openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, const int type, con= st char *argv[], const char *envp[]) +openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, const int type, con= st char **/*argv[]*/, const char *envp[]) { struct down_root_context *context =3D (struct down_root_context *) han= dle; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/861?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: I1146da697adb8a200df0507dc7ec931c36738ffa Gerrit-Change-Number: 861 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --fnUNggnkaQU= 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

Fix various compiler warnings for intentionally unused parame=
ters

Change-Id: I1146da697adb8a200df0507dc7ec931c36738ffa
Signed-= off-by: Frank Lichtenheld <frank@...2641...>
---
M src/openvpn/= dco_win.h
M src/openvpn/event.h
M src/openvpn/multi.c
M src/openvp= n/perf.h
M src/openvpn/route.c
M src/openvpn/route.h
M src/openvpn= /ssl.c
M src/openvpn/tun.h
M src/openvpn/xkey_provider.c
M src/plu= gins/auth-pam/auth-pam.c
M src/plugins/down-root/down-root.c
11 files= changed, 30 insertions(+), 30 deletions(-)

git pull ssh://gerrit=
.openvpn.net:29418/openvpn refs/changes/61/861/1
diff --git a/src/o=
penvpn/dco_win.h b/src/openvpn/dco_win.h
index 7688516..99c= 9252 100644
--- a/src/openvpn/dco_win.h
+++= b/src/openvpn/dco_win.h
@@ -54,7 +54,7 @@
= #else /* if defined(ENABLE_DCO) && defined(_WIN32) */

static inline void
-dco_start_tun(struct tuntap *tt)
+dco_start_tun(struct tuntap *)
= {
ASSERT(false);
}
<= span>diff --git a/src/openvpn/event.h b/src/openvpn/event.h
index c212e07..d792145 100644
--- a/src/openvpn/event.h

+++ b/src/openvpn/event.h
@@ -214,7 +214,7 @@=
#else /* ifdef _WIN32 */

static inline void
= -wait_signal(struct event_set *es, void *arg)
+wait_signal(struct event_set *, void *) {
}

diff --git a= /src/openvpn/multi.c b/src/openvpn/multi.c
index f426b46..7= fa3b43 100644
--- a/src/openvpn/multi.c
+++= b/src/openvpn/multi.c
@@ -252,7 +252,7 @@
= #ifdef ENABLE_MANAGEMENT

static uint32_= t
-cid_hash_function(co= nst void *key, uint32_t iv)
+cid_hash_function(const void *key, uint32_t /*iv*/)
{
const unsigned long *k =3D (const unsigned long *)= key;
return (uint32_t) *k;
@@ -273,7 += 273,7 @@
/*
* inotify watcher descriptor= s are used as hash value
*/
-int_hash_function(const void *key, uint32_t iv)

+int_hash_function(const= void *key, uint32_t /*iv*/)
{
return= (unsigned long)key;
}
diff --git a/src/op= envpn/perf.h b/src/openvpn/perf.h
index 04abe89..d394347 10= 0644
--- a/src/openvpn/perf.h
+++ b/src/ope= nvpn/perf.h
@@ -75,7 +75,7 @@
#else /* if= def ENABLE_PERFORMANCE_METRICS */

static= inline void
-perf_push= (int type)
+perf_push= (int)
{
}
static inline = void
diff --git a/src/openvpn/route.c b/src/openvpn/route.c=
index d17b285..2aa33d0 100644
--- a/src/op= envpn/route.c
+++ b/src/openvpn/route.c
@@ = -4181,7 +4181,7 @@
#else /* if defined(_WIN32) */<= br>
static void
-get_bypass_addresses(struct route_bypass *rb, const unsig= ned int flags) /* PLATFORM-SPECIFIC */
+get_bypass_addresses(struct route_bypass *, const unsi= gned int) /* PLATFORM-SPECIFIC */
{
}

diff --git a/src/openvpn/route.h b/src/ope= nvpn/route.h
index 421e7d2..e605d8b 100644
= --- a/src/openvpn/route.h
+++ b/src/openvpn/route.h<= br>@@ -365,7 +365,7 @@

#else /* i= fdef _WIN32 */
static inline bool
-test_routes(const struct route_list *rl, const= struct tuntap *tt)
+= test_routes(const struct route_list *, const struct tuntap *)
{

return true;
}
= diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index e4= a7b57..631e547 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -257,7 +257,7 @@
}

int
-pem_password_callback(char *buf, int size, int rwfl= ag, void *u)
+pem_pas= sword_callback(char *buf, int size, int /*rwflag*/, void */*u*/)
= {
if (buf)
{
diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h
index= ccba0bc..a5b9a48 100644
--- a/src/openvpn/tun.h
= +++ b/src/openvpn/tun.h
@@ -698,37 +698,37 @@<= br> #else /* ifdef _WIN32 */

stat= ic inline bool
-tuntap_= stop(int status)
+tun= tap_stop(int)
{
return false;<= br> }

static inline bool-tuntap_abort(int status)=
+tuntap_abort(int) {
return false;
}
=
static inline void
-tun_standby_init(struct tuntap *tt)
+tun_standby_init(struct tuntap *)

{
}

stati= c inline bool
-tun_stan= dby(struct tuntap *tt)
-tuntap_is_dco_win(struct tuntap *tt)
+tuntap_is_dco_win(struct tuntap *)
{<= /span>
return false;
}

static inline bool
-tuntap_is_dco_win_timeout(struct tuntap *tt, int status)<= br>+tuntap_is_dco_win_timeout(s= truct tuntap *, int)
{
return false;<= /span>
}
diff --git a/src/openvpn/xkey_provider.c= b/src/openvpn/xkey_provider.c
index 964d2eb..8efcd9e 10064= 4
--- a/src/openvpn/xkey_provider.c
+++ b/s= rc/openvpn/xkey_provider.c
@@ -204,7 +204,7 @@
}


static void *
-keymgmt_load(const void *reference, size_= t reference_sz)
+keym= gmt_load(const void */*reference*/, size_t /*reference_sz*/)
{
xkey_dmsg(D_XKEY, "entry");
<= span>
@@ -416,7 +416,7 @@

/* A minimal set of key params that we can return */
st= atic const OSSL_PARAM *
-keymgmt_gettable_params(void *provctx)
+keymgmt_gettable_params(void */*provctx*/)
<= span> {
xkey_dmsg(D_XKEY, "entry");
@@ -558,7 +558,7 @@
}
=
static const char *
-rsa_keymgmt_name(int id)
+rsa_keymgmt_name(int /*id*/)
{=
xkey_dmsg(D_XKEY, "entry");

@@ -761,7 +761,7 @@
}
=
static const OSSL_PARAM *
-signature_settable_ctx_params(void *ctx, void *provct= x)
+signature_settabl= e_ctx_params(void */*ctx*/, void */*provctx*/)
{ xkey_dmsg(D_XKEY, "entry");
<= br>@@ -874,7 +874,7 @@
}
static const OSSL_PARAM *
-signature_gettable_ctx_params(void *ctx, void *provctx)<= br>+signature_gettable_ctx_para= ms(void */*ctx*/, void */*provctx*/)
{
= xkey_dmsg(D_XKEY, "entry");

@= @ -884,7 +884,7 @@
}

st= atic int
-signature_get= _ctx_params(void *ctx, OSSL_PARAM params[])
+signature_get_ctx_params(void */*ctx*/, OSSL_PARAM = */*params[]*/)
{
xkey_dmsg(D_XKEY, &q= uot;not implemented");
return 0;
= @@ -936,7 +936,7 @@
}

s= tatic int
-signature_si= gn(void *ctx, unsigned char *sig, size_t *siglen, size_t sigsize,+signature_sign(void *ctx, uns= igned char *sig, size_t *siglen, size_t /*sigsize*/,
= const unsigned char *tbs, size_t tbslen)
{

xkey_dmsg(D_XKEY, "entry with siglen =3D %zu\n", = *siglen);
@@ -956,8 +956,8 @@
}
=
static int
-signature_digest_verify_init(void *ctx, const char *mdname, v= oid *provkey,
- = const OSSL_PARAM params[])
+signature_digest_verify_init(void */*ctx*/, con= st char *mdname, void */*provkey*/,
+ const OSSL_PARAM */*params[]*/= )
{
xkey_dmsg(D_XKEY, "mdname &l= t;%s>", mdname);

@@ -970,8 +970,8= @@
* for debugging purposes.
*/=
static int
-= signature_digest_verify(void *ctx, const unsigned char *sig, size_t siglen,=
- = const unsigned char *tbs, size_t tbslen)
+signature_digest_verify(void */*ctx*/, const unsign= ed char */*sig*/, size_t /*siglen*/,
+ const unsigned char */*tbs*/, size= _t /*tbslen*/)
{
xkey_dmsg(D_XKEY, &q= uot;entry");

@@ -1166,7 +1166,7 @@
static OSSL_FUNC_provider_teardown_fn teardown;
<= span>

static const OSSL_ALGORITHM *
-query_operation(void *provctx, int op, int = *no_store)
+query_ope= ration(void */*provctx*/, int op, int *no_store)
{<= br> xkey_dmsg(D_XKEY, "op =3D %d", op);

@@ -1188,7 +1188,7 @@
}

static const OSSL_PARAM *
-gettable_params(void *provctx)
+gettable_params(void */*provctx*/)

{
xkey_dmsg(D_XKEY, "entry");

@@ -1200,7 +1200,7 @@
= return param_types;
}
static int-get_params(void *provctx, OSSL= _PARAM params[])
+get= _params(void */*provctx*/, OSSL_PARAM params[])
{ OSSL_PARAM *p;

diff --git a/= src/plugins/auth-pam/auth-pam.c b/src/plugins/auth-pam/auth-pam.cindex 54cab33..7aa477c 100644
--- a/src/plugins/auth= -pam/auth-pam.c
+++ b/src/plugins/auth-pam/auth-pam.c

@@ -520,7 +520,7 @@
}
<= br> OPENVPN_EXPORT int
-openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, const int typ= e, const char *argv[], const char *envp[])
+openvpn_plugin_func_v1(openvpn_plugin_handle_t handl= e, const int type, const char **/*argv[]*/, const char *envp[])
<= span> {
struct auth_pam_context *context =3D (struct a= uth_pam_context *) handle;

diff --git a/s= rc/plugins/down-root/down-root.c b/src/plugins/down-root/down-root.c=
index 384bc81..3a152b1 100644
--- a/src/plugins/d= own-root/down-root.c
+++ b/src/plugins/down-root/down-root.= c
@@ -344,7 +344,7 @@
}
<= /span>
OPENVPN_EXPORT int
-openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, const = int type, const char *argv[], const char *envp[])
+openvpn_plugin_func_v1(openvpn_plugin_handle_= t handle, const int type, const char **/*argv[]*/, const char *envp[])

{
struct down_root_context *context =3D (= struct down_root_context *) handle;


To view, visit change 861. To unsubscribe, or for help writing ma= il filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1146da697adb8a200df0507dc7e= c931c36738ffa
Gerrit-Change-Number: 861
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
--fnUNggnkaQU=--