From c0ae59e1022071539cd9ce2343cf486cf69b94f2 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 30 Nov 2018 17:49:29 +0100 Subject: [PATCH] bignum: Use UNUSED macros --- ConfigureChecks.cmake | 34 ++++++++++++++++++---------------- src/bignum.c | 8 ++++---- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index d4e9f105..7c24dfd9 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -343,25 +343,27 @@ int main(void) { return 0; }" HAVE_FALLTHROUGH_ATTRIBUTE) -check_c_source_compiles(" -#define __unused __attribute__((unused)) +if (NOT WIN32) + check_c_source_compiles(" + #define __unused __attribute__((unused)) -static int do_nothing(int i __unused) -{ - return 0; -} - -int main(void) -{ - int i; - - i = do_nothing(5); - if (i > 5) { - return 1; + static int do_nothing(int i __unused) + { + return 0; } - return 0; -}" HAVE_UNUSED_ATTRIBUTE) + int main(void) + { + int i; + + i = do_nothing(5); + if (i > 5) { + return 1; + } + + return 0; + }" HAVE_UNUSED_ATTRIBUTE) +endif() check_c_source_compiles(" #include diff --git a/src/bignum.c b/src/bignum.c index 3a0c6a03..6777f023 100644 --- a/src/bignum.c +++ b/src/bignum.c @@ -88,12 +88,12 @@ bignum ssh_make_string_bn(ssh_string string){ return bn; } -void ssh_make_string_bn_inplace(ssh_string string, bignum bnout) { - size_t len = ssh_string_len(string); +void ssh_make_string_bn_inplace(ssh_string string, + UNUSED_PARAM(bignum bnout)) +{ + UNUSED_VAR(size_t len) = ssh_string_len(string); #ifdef HAVE_LIBGCRYPT /* XXX: FIXME as needed for LIBGCRYPT ECDSA codepaths. */ - (void) len; - (void) bnout; #elif defined HAVE_LIBCRYPTO bignum_bin2bn(string->data, len, bnout); #elif defined HAVE_LIBMBEDCRYPTO