From c43d54826fd92017b9d7d49a5f660d98c0393e02 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 27 Jul 2024 19:05:00 -0400 Subject: build/flags: Add -Wmissing-variable-declarations if supported --- build/flags.mk | 3 ++- build/flags/missing-var-decls.c | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 build/flags/missing-var-decls.c (limited to 'build') 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 +// SPDX-License-Identifier: 0BSD + +/// _CFLAGS += -Wmissing-variable-declarations +/// -Werror + +int main(void) { + return 0; +} -- cgit v1.2.3