From bf3fd83b648d46dab6de6a97fd5c07df9e0159b5 Mon Sep 17 00:00:00 2001 From: omicron Date: Thu, 17 Apr 2025 15:18:28 +0200 Subject: [PATCH] Let the release build error on warnings Add -Werror to the release configuration. Also add the release build as a dependency of the make validate rule. The idea is that builds should not pass validation if they have warnings but it shouldn't stop debug builds during development from compiling while work is in progress. --- Makefile | 2 +- make/release.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1983303..a6b1f0b 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ asan: msan: make -rRf make/msan.mk all -validate: asan msan debug +validate: asan msan debug release ./validate.sh analyze: diff --git a/make/release.mk b/make/release.mk index 606940c..d58017b 100644 --- a/make/release.mk +++ b/make/release.mk @@ -1,4 +1,4 @@ -CFLAGS?=-Wall -Wextra -Wpedantic -O2 -std=c23 -flto -fomit-frame-pointer -DNDEBUG -D_POSIX_C_SOURCE=200809L +CFLAGS?=-Wall -Wextra -Wpedantic -Werror -O2 -std=c23 -flto -fomit-frame-pointer -DNDEBUG -D_POSIX_C_SOURCE=200809L LDFLAGS?=-flto -s -Wl,--gc-sections BUILD_DIR?=build/release/