]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Ignore unused arguments warnings in engine.h stubs.
authorMilan Broz <gmazyland@gmail.com>
Tue, 11 Nov 2025 10:48:41 +0000 (11:48 +0100)
committerNeil Horman <nhorman@openssl.org>
Thu, 4 Dec 2025 12:32:18 +0000 (07:32 -0500)
This add pragma setting for gcc an clang compilers.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29305)

include/openssl/engine.h

index dee79ba56efbc0e024c7c1f893e369fe9695f836..11f5ee082292d2a863c2a14529ad11cec380091b 100644 (file)
@@ -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) \
 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 */