mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-07 10:27:47 -05:00
![]() Avoid static analyzer warnings regarding "Function call argument is a pointer to uninitialized value" in cases where we are intentionally using such arguments. This is achieved by using ... `f(b.begin(), b.end())` (`std::array<char, N>`) ... instead of ... `f(b, b + N)` (`char b[N]`) Rationale: * Reduce false positives by guiding static analyzers regarding our intentions. Before this commit: ``` $ clang-tidy-3.5 -checks=* src/bench/base58.cpp bench/base58.cpp:23:9: warning: Function call argument is a pointer to uninitialized value [clang-analyzer-core.CallAndMessage] EncodeBase58(b, b + 32); ^ $ clang-tidy-3.5 -checks=* src/bench/verify_script.cpp bench/verify_script.cpp:59:5: warning: Function call argument is a pointer to uninitialized value [clang-analyzer-core.CallAndMessage] key.Set(vchKey, vchKey + 32, false); ^ $ ``` After this commit: ``` $ clang-tidy-3.5 -checks=* src/bench/base58.cpp $ clang-tidy-3.5 -checks=* src/bench/verify_script.cpp $ ``` |
||
---|---|---|
.. | ||
data | ||
.gitignore | ||
base58.cpp | ||
bench.cpp | ||
bench.h | ||
bench_bitcoin.cpp | ||
ccoins_caching.cpp | ||
checkblock.cpp | ||
checkqueue.cpp | ||
coin_selection.cpp | ||
crypto_hash.cpp | ||
Examples.cpp | ||
lockedpool.cpp | ||
mempool_eviction.cpp | ||
perf.cpp | ||
perf.h | ||
prevector_destructor.cpp | ||
rollingbloom.cpp | ||
verify_script.cpp |