From 4c70cc9bf56ab36f20cba5695d4f728a84779f91 Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Thu, 27 Jul 2023 16:12:47 +0200 Subject: [PATCH] Suppress wrong/buggy warning in MSVC <19.33 For background, see: https://developercommunity.visualstudio.com/t/c-compiler-incorrect-propagation-of-const-qualifie/390711 --- src/modules/extrakeys/main_impl.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/extrakeys/main_impl.h b/src/modules/extrakeys/main_impl.h index 4fb18771..7a7015e1 100644 --- a/src/modules/extrakeys/main_impl.h +++ b/src/modules/extrakeys/main_impl.h @@ -328,7 +328,19 @@ int secp256k1_pubkey_sort(const secp256k1_context* ctx, const secp256k1_pubkey * ARG_CHECK(pubkeys != NULL); cmp_data.ctx = ctx; + + /* Suppress wrong warning (fixed in MSVC 19.33) */ + #if defined(_MSC_VER) && (_MSC_VER < 1933) + #pragma warning(push) + #pragma warning(disable: 4090) + #endif + secp256k1_hsort(pubkeys, n_pubkeys, sizeof(*pubkeys), secp256k1_pubkey_sort_cmp, &cmp_data); + + #if defined(_MSC_VER) && (_MSC_VER < 1933) + #pragma warning(pop) + #endif + return 1; }