aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-06-21 12:14:25 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-06-21 12:14:25 +0200
commit19508b74b89650b762a691256fb38cf823071ffe (patch)
treef7c6dffb22a6ff03904750e5815e167fa61dfcbe
parent674fe912b70e256790c6ac046b8f7c47af87d1e3 (diff)
downloadffwd-19508b74b89650b762a691256fb38cf823071ffe.tar.gz
ffwd-19508b74b89650b762a691256fb38cf823071ffe.zip
build: -Werror=implicit-function-declaration to catch missing prototypes
-rw-r--r--build.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/build.mk b/build.mk
index 0a67721..fda44f8 100644
--- a/build.mk
+++ b/build.mk
@@ -61,8 +61,12 @@ MLXC_PREFIX := $(shell brew --prefix mlx-c 2>/dev/null)
# -std=c11: strict C11 defines __STRICT_ANSI__, so glibc otherwise hides them,
# and an implicit int return truncates the 64-bit pointer (crashes on Linux;
# macOS declares them regardless, which hid this).
+# -Werror=implicit-function-declaration turns a missing prototype into a build
+# failure instead of a buried -Wall warning: that is exactly how the strdup
+# truncation above slipped through (an implicit int return -> mangled pointer,
+# crashing only on Linux). It is a hard error in C23 anyway.
CFLAGS_BASE = -Wall -Wextra -O3 $(ARCH_FLAGS) -fPIC -fvisibility=hidden \
- -D_DEFAULT_SOURCE \
+ -D_DEFAULT_SOURCE -Werror=implicit-function-declaration \
-fno-math-errno -ffp-contract=fast -fno-trapping-math \
-fno-signed-zeros -fassociative-math -freciprocal-math