Fix static analysis warnings.
Newly reported warnings included several reserved macro identifier, and false-positive used-uninitialized.
This commit is contained in:
parent
5b72ac098a
commit
bd0a5b0f3b
|
@ -53,7 +53,8 @@ CC_ANALYZERS_FROM_PATH=1 CodeChecker analyze compile_commands.json --jobs "$(npr
|
|||
--ctu --compile-uniqueing strict --output static_analysis_raw_results \
|
||||
--analyzers clangsa clang-tidy --skip "$skipfile" \
|
||||
--enable readability-inconsistent-declaration-parameter-name \
|
||||
--enable performance-no-int-to-ptr
|
||||
--enable performance-no-int-to-ptr \
|
||||
--disable clang-diagnostic-reserved-macro-identifier
|
||||
# `--enable` is additive, the vast majority of the checks we want are
|
||||
# enabled by default.
|
||||
|
||||
|
|
|
@ -473,7 +473,7 @@ arena_decay_impl(tsdn_t *tsdn, arena_t *arena, decay_t *decay,
|
|||
arena_decide_unforced_purge_eagerness(is_background_thread);
|
||||
bool epoch_advanced = pac_maybe_decay_purge(tsdn, &arena->pa_shard.pac,
|
||||
decay, decay_stats, ecache, eagerness);
|
||||
size_t npages_new;
|
||||
size_t npages_new JEMALLOC_CLANG_ANALYZER_SILENCE_INIT(0);
|
||||
if (epoch_advanced) {
|
||||
/* Backlog is updated on epoch advance. */
|
||||
npages_new = decay_epoch_npages_delta(decay);
|
||||
|
|
|
@ -3165,7 +3165,7 @@ arena_i_name_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
|||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
int ret;
|
||||
unsigned arena_ind;
|
||||
char *name;
|
||||
char *name JEMALLOC_CLANG_ANALYZER_SILENCE_INIT(NULL);
|
||||
|
||||
malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx);
|
||||
MIB_UNSIGNED(arena_ind, 1);
|
||||
|
|
|
@ -1208,7 +1208,7 @@ thread_tcache_max_set(tsd_t *tsd, size_t tcache_max) {
|
|||
assert(tcache != NULL && tcache_slow != NULL);
|
||||
|
||||
bool enabled = tcache_available(tsd);
|
||||
arena_t *assigned_arena;
|
||||
arena_t *assigned_arena JEMALLOC_CLANG_ANALYZER_SILENCE_INIT(NULL);
|
||||
if (enabled) {
|
||||
assigned_arena = tcache_slow->arena;
|
||||
/* Carry over the bin settings during the reboot. */
|
||||
|
|
Loading…
Reference in New Issue