clang 13.0.0's scan-build reports: * Logic error "Result of operation is garbage or undefined" in `crypto_aesctr_stream_cipherblock_use`. This is discussed in https://github.com/Tarsnap/libcperciva/issues/372. TL;DR: clang doesn't realize that writing a 32-bit integer will initialize all 4 bytes. * Logic error "Assigned value is garbage or undefined" in `_mm_loadu_si64` (called from `cpusupport-X86-AESNI.c`) This is discussed in https://github.com/Tarsnap/libcperciva/issues/423. TL;DR: clang-scan doesn't like its own `<emmintrin.h>` header. * Memory error "Potential leak of memory pointed to by 'R'" in `dnsthread_resolve()` in `lib/dnsthread/dnsthread.c`. That's the `struct resolve_cookie * R`. This is because `R` is freed in `callback_resolve()`. We can see from the valgrind memory test of `07-dnsthread-resolve.sh` that this value is freed.
clang 13.0.0's scan-build reports:
Logic error "Result of operation is garbage or undefined" in
crypto_aesctr_stream_cipherblock_use.This is discussed in False clang-scan warning, likely from be64enc libcperciva#372.
TL;DR: clang doesn't realize that writing a 32-bit integer will initialize all 4 bytes.
Logic error "Assigned value is garbage or undefined" in
_mm_loadu_si64(called fromcpusupport-X86-AESNI.c)This is discussed in False clang-scan warning in _mm_loadu_si64 libcperciva#423.
TL;DR: clang-scan doesn't like its own
<emmintrin.h>header.Memory error "Potential leak of memory pointed to by 'R'" in
dnsthread_resolve()inlib/dnsthread/dnsthread.c. That's thestruct resolve_cookie * R.This is because
Ris freed incallback_resolve(). We can see from the valgrind memory test of07-dnsthread-resolve.shthat this value is freed.