diff options
author | Brad King <brad.king@kitware.com> | 2023-05-22 14:01:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-05-22 20:51:16 (GMT) |
commit | d531b9e7d151124a2a31ff19ac7b5a25671da5c2 (patch) | |
tree | c6f5d55d64adce82bb1b1f3ddeaea970022497e6 /Utilities/cmzstd | |
parent | bba02b8b4beda4abacd5d3aa74d2d5e2ac1d717b (diff) | |
download | CMake-d531b9e7d151124a2a31ff19ac7b5a25671da5c2.zip CMake-d531b9e7d151124a2a31ff19ac7b5a25671da5c2.tar.gz CMake-d531b9e7d151124a2a31ff19ac7b5a25671da5c2.tar.bz2 |
zstd: Suppress clang-analyzer warnings
Diffstat (limited to 'Utilities/cmzstd')
-rw-r--r-- | Utilities/cmzstd/lib/common/bitstream.h | 2 | ||||
-rw-r--r-- | Utilities/cmzstd/lib/compress/fse_compress.c | 4 | ||||
-rw-r--r-- | Utilities/cmzstd/lib/dictBuilder/divsufsort.c | 11 |
3 files changed, 17 insertions, 0 deletions
diff --git a/Utilities/cmzstd/lib/common/bitstream.h b/Utilities/cmzstd/lib/common/bitstream.h index 2e5a933..136a188 100644 --- a/Utilities/cmzstd/lib/common/bitstream.h +++ b/Utilities/cmzstd/lib/common/bitstream.h @@ -14,6 +14,8 @@ #ifndef BITSTREAM_H_MODULE #define BITSTREAM_H_MODULE +#include <assert.h> + #if defined (__cplusplus) extern "C" { #endif diff --git a/Utilities/cmzstd/lib/compress/fse_compress.c b/Utilities/cmzstd/lib/compress/fse_compress.c index b4297ec..1b6a076 100644 --- a/Utilities/cmzstd/lib/compress/fse_compress.c +++ b/Utilities/cmzstd/lib/compress/fse_compress.c @@ -646,6 +646,10 @@ size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t src void* scratchBuffer = (void*)(CTable + CTableSize); size_t const scratchBufferSize = wkspSize - (CTableSize * sizeof(FSE_CTable)); +#ifdef __clang_analyzer__ + memset(norm, 0, sizeof(norm)); +#endif + /* init conditions */ if (wkspSize < FSE_COMPRESS_WKSP_SIZE_U32(tableLog, maxSymbolValue)) return ERROR(tableLog_tooLarge); if (srcSize <= 1) return 0; /* Not compressible */ diff --git a/Utilities/cmzstd/lib/dictBuilder/divsufsort.c b/Utilities/cmzstd/lib/dictBuilder/divsufsort.c index a2870fb..8d52b18 100644 --- a/Utilities/cmzstd/lib/dictBuilder/divsufsort.c +++ b/Utilities/cmzstd/lib/dictBuilder/divsufsort.c @@ -40,6 +40,10 @@ #include <stdio.h> #include <stdlib.h> +#ifdef __clang_analyzer__ +#include <string.h> +#endif + #include "divsufsort.h" /*- Constants -*/ @@ -1119,6 +1123,9 @@ tr_copy(int *ISA, const int *SA, v = b - SA - 1; for(c = first, d = a - 1; c <= d; ++c) { + #ifdef __clang_analyzer__ + assert(c); + #endif if((0 <= (s = *c - depth)) && (ISA[s] == v)) { *++d = s; ISA[s] = d - SA; @@ -1184,6 +1191,10 @@ tr_introsort(int *ISA, const int *ISAd, int limit, next; int ssize, trlink = -1; + #ifdef __clang_analyzer__ + memset(stack, 0, sizeof(stack)); + #endif + for(ssize = 0, limit = tr_ilg(last - first);;) { if(limit < 0) { |