From: Milan Broz Date: Tue, 11 Nov 2025 10:48:41 +0000 (+0100) Subject: Ignore unused arguments warnings in engine.h stubs. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=80db9e92fd1d2b693b0e6f756b4f71b47b57ceae;p=thirdparty%2Fopenssl.git Ignore unused arguments warnings in engine.h stubs. This add pragma setting for gcc an clang compilers. Signed-off-by: Milan Broz Reviewed-by: Neil Horman Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz Reviewed-by: Saša Nedvědický Reviewed-by: Eugene Syromiatnikov Reviewed-by: Norbert Pocs (Merged from https://github.com/openssl/openssl/pull/29305) --- diff --git a/include/openssl/engine.h b/include/openssl/engine.h index dee79ba56ef..11f5ee08229 100644 --- a/include/openssl/engine.h +++ b/include/openssl/engine.h @@ -36,7 +36,6 @@ OSSL_DEPRECATED_MESSAGE(#name ENGINE_INFO_MSG) \ static inline ret_type name args \ { \ - (void)args_names; /* avoid unused parameter warnings */ \ return default_val; /* stub return */ \ } @@ -51,7 +50,6 @@ OSSL_DEPRECATED_MESSAGE(#name ENGINE_INFO_MSG) \ static inline void name args \ { \ - (void)args_names; /* avoid unused parameter warnings */ \ } # define ENGINE_VOID_FUNC_NOARGS(name) \ @@ -100,6 +98,15 @@ extern "C" { # endif +/* Ignore stubs unused arguments */ +# if defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-value" +# elif defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunused-value" +# endif + /* * These flags are used to control combinations of algorithm (methods) by * bitwise "OR"ing. @@ -1218,5 +1225,12 @@ ENGINE_FUNC(int, SSL_CTX_set_client_cert_engine, (SSL_CTX *ctx, ENGINE *e), # undef ENGINE_VOID_FUNC # undef ENGINE_FUNC_NOARGS # undef ENGINE_VOID_FUNC_NOARGS + +# if defined(__GNUC__) +# pragma GCC diagnostic pop +# elif defined(__clang__) +# pragma clang diagnostic pop +# endif + # endif #endif /* OPENSSL_ENGINE_H */