From a97bfc684ecaf5fa6cb6d809806c752af811cd47 Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Wed, 18 Mar 2026 01:30:02 +0100 Subject: [PATCH] Fix: GCC warning flags conditional (Clang doesn't support them) --- Makefile.cbm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.cbm b/Makefile.cbm index 1326f98c9..4d198bf93 100644 --- a/Makefile.cbm +++ b/Makefile.cbm @@ -31,9 +31,12 @@ LIBGIT2_FLAGS = LIBGIT2_LIBS = endif +# GCC-specific warning suppressions (Clang doesn't have these flags) +GCC_NOWARN := $(shell $(CC) -Wno-format-truncation -x c -c /dev/null -o /dev/null 2>/dev/null && echo "-Wno-format-truncation -Wno-restrict -Wno-unused-result") + CFLAGS_COMMON = -std=c11 -D_DEFAULT_SOURCE -Wall -Wextra -Werror \ -Wno-unused-parameter -Wno-sign-compare \ - -Wno-format-truncation -Wno-restrict -Wno-unused-result \ + $(GCC_NOWARN) \ -Isrc -Ivendored -Ivendored/sqlite3 \ -Ivendored/mimalloc/include \ -I$(CBM_DIR) -I$(TS_INCLUDE) \