summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-07-27 19:05:00 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-07-27 19:05:00 -0400
commitc43d54826fd92017b9d7d49a5f660d98c0393e02 (patch)
tree7a04f1d78bec610a3c06fe0ca418df10b53bec48
parent3552b793e3b30f2bba0e77fbda45a86575f4dae6 (diff)
downloadbfs-c43d54826fd92017b9d7d49a5f660d98c0393e02.tar.xz
build/flags: Add -Wmissing-variable-declarations if supported
-rw-r--r--build/flags.mk3
-rw-r--r--build/flags/missing-var-decls.c9
2 files changed, 11 insertions, 1 deletions
diff --git a/build/flags.mk b/build/flags.mk
index 95d5673..5c28c3f 100644
--- a/build/flags.mk
+++ b/build/flags.mk
@@ -105,7 +105,8 @@ include build/exports.mk
# Conditionally-supported flags
AUTO_FLAGS := \
- gen/flags/deps.mk
+ gen/flags/deps.mk \
+ gen/flags/missing-var-decls.mk
gen/flags.mk: ${AUTO_FLAGS}
${MSG} "[ GEN] $@"
diff --git a/build/flags/missing-var-decls.c b/build/flags/missing-var-decls.c
new file mode 100644
index 0000000..5c20cc6
--- /dev/null
+++ b/build/flags/missing-var-decls.c
@@ -0,0 +1,9 @@
+// Copyright © Tavian Barnes <tavianator@tavianator.com>
+// SPDX-License-Identifier: 0BSD
+
+/// _CFLAGS += -Wmissing-variable-declarations
+/// -Werror
+
+int main(void) {
+ return 0;
+}