summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2025-05-26 08:49:19 +0200
committerFlorian Weimer <fweimer@redhat.com>2025-05-26 08:49:22 +0200
commit4f4c4fcde76aedc1f5362a51d98ebb57a28fbce9 (patch)
tree0b48f7ff75de6ed0271cf6614279962b9107d5bb /configure.ac
parent319f94dea2b7eeff12adb22ee50b46b64dd6a52d (diff)
Turn on -Wfree-labels by default if available
This flags a hazard for backporting changes to earlier branches. Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index abd3b238d2..6cf66c82a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1575,6 +1575,17 @@ LIBC_CONFIG_VAR([cc-option-wimplicit-fallthrough],
[$libc_cv_cc_wimplicit_fallthrough])
AC_SUBST(libc_cv_test_cc_wimplicit_fallthrough)
+LIBC_TRY_CC_AND_TEST_CC_OPTION([for -Wfree-labels],
+ [-Werror -Wfree-labels],
+ libc_cv_cc_wfree_labels,
+ [libc_cv_cc_wfree_labels=-Wfree-labels],
+ [libc_cv_cc_wfree_labels=],
+ libc_cv_test_cc_wfree_labels,
+ [libc_cv_test_cc_wfree_labels=-Wfree-labels],
+ [libc_cv_test_cc_wfree_labels=])
+LIBC_CONFIG_VAR([cc-option-wfree-labels], [$libc_cv_cc_wfree_labels])
+AC_SUBST(libc_cv_test_cc_wfree_labels)
+
conftest_code="
void bar (void (*callback) (void));
int foo (void)