Skip to content

False warnings from clang's scan-build #330

@gperciva

Description

@gperciva

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 from cpusupport-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() 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Not a problemFalse warnings from compilers or analysis tools

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions