Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

Add _DEFAULT_SOURCE to all CFLAGS (mongoose, grammars) for Linux POSIX compat

Martin Vogel0aabc447f6b6
diff --git a/Makefile.cbm b/Makefile.cbm
index 6d51de44b..656c3efbe 100644
--- a/Makefile.cbm
+++ b/Makefile.cbm
@@ -174,8 +174,8 @@ UI_SRCS = \
# Mongoose HTTP library (vendored, compiled with relaxed warnings)
MONGOOSE_SRC = vendored/mongoose/mongoose.c
-MONGOOSE_CFLAGS = -std=c11 -O2 -w -Ivendored -DMG_ENABLE_LOG=0
-MONGOOSE_CFLAGS_TEST = -std=c11 -g -O1 -w -Ivendored -DMG_ENABLE_LOG=0 \
+MONGOOSE_CFLAGS = -std=c11 -D_DEFAULT_SOURCE -O2 -w -Ivendored -DMG_ENABLE_LOG=0
+MONGOOSE_CFLAGS_TEST = -std=c11 -D_DEFAULT_SOURCE -g -O1 -w -Ivendored -DMG_ENABLE_LOG=0 \
-fsanitize=address,undefined -fno-omit-frame-pointer
# mimalloc (vendored, global allocator override)
@@ -265,10 +265,10 @@ BUILD_DIR = build/c
# ── Object file compilation (grammars need relaxed warnings) ─────
# Grammar + tree-sitter runtime: compiled without -Werror (upstream code has warnings)
-GRAMMAR_CFLAGS = -std=c11 -O2 -w -I$(CBM_DIR) -I$(TS_INCLUDE)
-GRAMMAR_CFLAGS_TEST = -std=c11 -g -O1 -w -I$(CBM_DIR) -I$(TS_INCLUDE) \
+GRAMMAR_CFLAGS = -std=c11 -D_DEFAULT_SOURCE -O2 -w -I$(CBM_DIR) -I$(TS_INCLUDE)
+GRAMMAR_CFLAGS_TEST = -std=c11 -D_DEFAULT_SOURCE -g -O1 -w -I$(CBM_DIR) -I$(TS_INCLUDE) \
-fsanitize=address,undefined -fno-omit-frame-pointer
-GRAMMAR_CFLAGS_TSAN = -std=c11 -g -O1 -w -I$(CBM_DIR) -I$(TS_INCLUDE) \
+GRAMMAR_CFLAGS_TSAN = -std=c11 -D_DEFAULT_SOURCE -g -O1 -w -I$(CBM_DIR) -I$(TS_INCLUDE) \
-fsanitize=thread -fno-omit-frame-pointer
# Object files for grammars + ts_runtime + lsp_all + preprocessor