try to fix sanitisers

This commit is contained in:
2025-02-17 18:31:08 +01:00
parent 3daa7d417b
commit 0bfe244a2d
2 changed files with 4 additions and 2 deletions

2
.vscode/launch.json vendored
View File

@@ -7,6 +7,8 @@
"request": "launch", "request": "launch",
"env": { "env": {
"DEBUG": "1", "DEBUG": "1",
"ASAN_OPTIONS": "detect_leaks=0",
"UBSAN_OPTIONS": "print_stacktrace=1:halt_on_error=1",
}, },
"program": "", "program": "",
"linux": { "linux": {

View File

@@ -8,7 +8,7 @@ CFLAGS := $(shell pkg-config --cflags sdl2) -Wall -Wextra -Wpedantic -Wno-pointe
LDFLAGS := $(shell pkg-config --libs sdl2) -lm LDFLAGS := $(shell pkg-config --libs sdl2) -lm
ifeq ($(DEBUG),1) ifeq ($(DEBUG),1)
CFLAGS += -DDEBUG -Og -g -fsanitize=address,undefined,leak,integer CFLAGS += -DDEBUG -fsanitize=address,undefined,integer -g -Og
else else
REL_FLAGS += -O3 REL_FLAGS += -O3
endif endif
@@ -46,7 +46,7 @@ _build: compile_commands.json $(DIR) $(TARGET) $(ASSETS)
clean: clean:
rm -rf $(DIR_BIN) $(DIR_OBJ) compile_commands.json rm -rf $(DIR_BIN) $(DIR_OBJ) compile_commands.json
# create the binary # create the binary (linking step)
$(TARGET): $(OBJ) $(TARGET): $(OBJ)
@$(call wr_colour,"using arguments: $(CFLAGS) $(LDFLAGS)",94) @$(call wr_colour,"using arguments: $(CFLAGS) $(LDFLAGS)",94)
@$(CC) -o $(TARGET) $^ $(CFLAGS) $(LDFLAGS) @$(CC) -o $(TARGET) $^ $(CFLAGS) $(LDFLAGS)