Skip to content

Commit 9afca37

Browse files
maplenkclaude
andcommitted
fix: suppress GCC false-positive -Wmaybe-uninitialized, fix TRE alignment
- Add -Wno-maybe-uninitialized to GCC-only flags (known false positive with ASan at -O1 on malloc return values) - Initialize node_ids to NULL before malloc for extra safety - Add -fno-sanitize=alignment for vendored TRE regex library (upstream has misaligned struct access on Windows) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b361eb6 commit 9afca37

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

Makefile.cbm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ IS_GCC := $(shell echo | $(CC) -dM -E - 2>/dev/null | grep -q '__GNUC__' && ! ec
4242
GCC_ONLY_FLAGS :=
4343
ifeq ($(IS_GCC),yes)
4444
GCC_ONLY_FLAGS := -Wno-format-truncation -Wno-unused-result \
45-
-Wno-stringop-truncation -Wno-alloc-size-larger-than
45+
-Wno-stringop-truncation -Wno-alloc-size-larger-than \
46+
-Wno-maybe-uninitialized
4647
endif
4748

4849
CFLAGS_COMMON = -std=c11 -D_DEFAULT_SOURCE -D_GNU_SOURCE -Wall -Wextra -Werror \
@@ -222,7 +223,7 @@ SQLITE3_CFLAGS_TEST = -std=c11 -g -O1 -w -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=1
222223

223224
# TRE regex (vendored, Windows only — POSIX uses system <regex.h>)
224225
TRE_SRC = vendored/tre/tre_all.c
225-
TRE_CFLAGS = -std=c11 -g -O1 -w -Ivendored/tre
226+
TRE_CFLAGS = -std=c11 -g -O1 -w -Ivendored/tre -fno-sanitize=alignment
226227

227228
# yyjson (vendored)
228229
YYJSON_SRC = vendored/yyjson/yyjson.c

src/store/store.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5903,7 +5903,8 @@ static int summary_build_clusters(const arch_summary_file_row_t *rows, int row_c
59035903
return CBM_STORE_OK;
59045904
}
59055905

5906-
int64_t *node_ids = malloc((size_t)row_count * sizeof(int64_t));
5906+
int64_t *node_ids = NULL;
5907+
node_ids = malloc((size_t)row_count * sizeof(int64_t));
59075908
if (!node_ids) {
59085909
return CBM_STORE_ERR;
59095910
}

0 commit comments

Comments
 (0)