From bf285500e603b77229bbaf9a87fe7f724bb5ffaa Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 30 Oct 2023 17:42:32 +0000 Subject: [PATCH] openssl: silence `-Wunused-value` warnings Seen with gcc 12. Manual: https://www.openssl.org/docs/man3.1/man3/BIO_reset.html ``` ./quictls/linux-a64-musl/usr/include/openssl/bio.h:555:34: warning: value computed is not used [-Wunused-value] 555 | # define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./libssh2/src/openssl.c:3518:5: note: in expansion of macro 'BIO_reset' ./libssh2/src/openssl.c:3884:5: note: in expansion of macro 'BIO_reset' ./libssh2/src/openssl.c:3995:5: note: in expansion of macro 'BIO_reset' ``` Ref: https://github.com/curl/curl-for-win/actions/runs/6696392318/job/18194032712#step:3:5060 Closes #1205 --- src/openssl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openssl.c b/src/openssl.c index 13b389c8..c190bbfa 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -3515,7 +3515,7 @@ _libssh2_pub_priv_keyfile(LIBSSH2_SESSION *session, "file: Unable to open private key file"); } - BIO_reset(bp); + (void)BIO_reset(bp); pk = PEM_read_bio_PrivateKey(bp, NULL, NULL, (void *)passphrase); BIO_free(bp); @@ -3881,7 +3881,7 @@ _libssh2_pub_priv_keyfilememory(LIBSSH2_SESSION *session, return _libssh2_error(session, LIBSSH2_ERROR_ALLOC, "Unable to allocate memory when" "computing public key"); - BIO_reset(bp); + (void)BIO_reset(bp); pk = PEM_read_bio_PrivateKey(bp, NULL, NULL, (void *)passphrase); #ifdef HAVE_SSLERROR_BAD_DECRYPT sslError = ERR_get_error(); @@ -3992,7 +3992,7 @@ _libssh2_sk_pub_keyfilememory(LIBSSH2_SESSION *session, return _libssh2_error(session, LIBSSH2_ERROR_ALLOC, "Unable to allocate memory when" "computing public key"); - BIO_reset(bp); + (void)BIO_reset(bp); pk = PEM_read_bio_PrivateKey(bp, NULL, NULL, (void *)passphrase); BIO_free(bp);