diff options
author | laanwj <126646+laanwj@users.noreply.github.com> | 2022-04-19 15:57:30 +0200 |
---|---|---|
committer | laanwj <126646+laanwj@users.noreply.github.com> | 2022-04-19 15:59:40 +0200 |
commit | f8b2e9bcfc76fede05f5e12f7b15f0d9c9d0add5 (patch) | |
tree | 30b65db1e0f73653fb9db2896e7fa7069070ab8c | |
parent | e0ff55a83621f4ead5d7a98315760e6108afd93a (diff) | |
parent | 07ddecb84e6097684fa56cfc79c8c2aad76f6604 (diff) | |
download | bitcoin-f8b2e9bcfc76fede05f5e12f7b15f0d9c9d0add5.tar.xz |
Merge bitcoin/bitcoin#24772: refactor: Use [[maybe_unused]] attribute
07ddecb84e6097684fa56cfc79c8c2aad76f6604 refactor: Use [[maybe_unused]] attribute (Hennadii Stepanov)
55e0fc8df9c4045453982888732a0dd7c99ea6d1 refactor: Drop unneeded workarounds aimed to silence unused warning (Hennadii Stepanov)
Pull request description:
This change is required for bitcoin/bitcoin#24773 as it prevents MSVC yelling about "warning C4551: function call missing argument list".
But it is useful by itself as it makes code more concise and readable.
ACKs for top commit:
Empact:
Code review ACK 07ddecb84e6097684fa56cfc79c8c2aad76f6604
laanwj:
Code review ACK 07ddecb84e6097684fa56cfc79c8c2aad76f6604
vincenzopalazzo:
ACK https://github.com/bitcoin/bitcoin/pull/24772/commits/07ddecb84e6097684fa56cfc79c8c2aad76f6604
w0xlt:
ACK 07ddecb
Tree-SHA512: 01791855a9ba742202d5718203303af989fcb501b7cf2a24ac8d78e87487acca38f77bef264b8e27e41ad1ccf96e426725cf65bfd96ce2ac71c46b3792bed857
-rw-r--r-- | src/crypto/sha256.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp index cde543e68c..196f81ea16 100644 --- a/src/crypto/sha256.cpp +++ b/src/crypto/sha256.cpp @@ -586,17 +586,9 @@ std::string SHA256AutoDetect() bool have_sse4 = false; bool have_xsave = false; bool have_avx = false; - bool have_avx2 = false; - bool have_x86_shani = false; - bool enabled_avx = false; - - (void)AVXEnabled; - (void)have_sse4; - (void)have_avx; - (void)have_xsave; - (void)have_avx2; - (void)have_x86_shani; - (void)enabled_avx; + [[maybe_unused]] bool have_avx2 = false; + [[maybe_unused]] bool have_x86_shani = false; + [[maybe_unused]] bool enabled_avx = false; uint32_t eax, ebx, ecx, edx; GetCPUID(1, 0, eax, ebx, ecx, edx); @@ -641,7 +633,7 @@ std::string SHA256AutoDetect() ret += ",avx2(8way)"; } #endif -#endif +#endif // defined(USE_ASM) && defined(HAVE_GETCPUID) #if defined(ENABLE_ARM_SHANI) && !defined(BUILD_BITCOIN_INTERNAL) bool have_arm_shani = false; |