Avoid the C-style cast to get rid of the warning.
This does not change the behavior.
Differential D4680
Fix -Wcast-align in crypto_hash.cpp Fabien on Dec 10 2019, 10:21. Authored by
Details
Avoid the C-style cast to get rid of the warning. This does not change the behavior. ninja bitcoin-bench Check the warning disappeared. ./src/bench/bitcoin-bench -filter=SipHash_32b Compare the benchmark result with master and check there is no
Diff Detail
Event Timeline
Comment Actions Memcpy to overlapping memory is also UB right? BTW what's wrong with just using non-union? uint64_t y = SipHashUint256(0, ++k1, x); std::memcpy(&x, &y, sizeof(y)); is the compiler unable to optimize that? (and, does it really matter if it's one extra instruction where y is probably a register?)
|