Skip to content

Commit f8b2e9b

Browse files
committed
Merge bitcoin/bitcoin#24772: refactor: Use [[maybe_unused]] attribute
07ddecb refactor: Use [[maybe_unused]] attribute (Hennadii Stepanov) 55e0fc8 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 07ddecb laanwj: Code review ACK 07ddecb vincenzopalazzo: ACK bitcoin/bitcoin@07ddecb w0xlt: ACK 07ddecb Tree-SHA512: 01791855a9ba742202d5718203303af989fcb501b7cf2a24ac8d78e87487acca38f77bef264b8e27e41ad1ccf96e426725cf65bfd96ce2ac71c46b3792bed857
2 parents e0ff55a + 07ddecb commit f8b2e9b

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/crypto/sha256.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -586,17 +586,9 @@ std::string SHA256AutoDetect()
586586
bool have_sse4 = false;
587587
bool have_xsave = false;
588588
bool have_avx = false;
589-
bool have_avx2 = false;
590-
bool have_x86_shani = false;
591-
bool enabled_avx = false;
592-
593-
(void)AVXEnabled;
594-
(void)have_sse4;
595-
(void)have_avx;
596-
(void)have_xsave;
597-
(void)have_avx2;
598-
(void)have_x86_shani;
599-
(void)enabled_avx;
589+
[[maybe_unused]] bool have_avx2 = false;
590+
[[maybe_unused]] bool have_x86_shani = false;
591+
[[maybe_unused]] bool enabled_avx = false;
600592

601593
uint32_t eax, ebx, ecx, edx;
602594
GetCPUID(1, 0, eax, ebx, ecx, edx);
@@ -641,7 +633,7 @@ std::string SHA256AutoDetect()
641633
ret += ",avx2(8way)";
642634
}
643635
#endif
644-
#endif
636+
#endif // defined(USE_ASM) && defined(HAVE_GETCPUID)
645637

646638
#if defined(ENABLE_ARM_SHANI) && !defined(BUILD_BITCOIN_INTERNAL)
647639
bool have_arm_shani = false;

0 commit comments

Comments
 (0)