Don't use -Wfree-labels/-Wmissing-parameter-name if unsupported

Don't use -Wfree-labels/-Wmissing-parameter-name for "make check" if
they are unsupported by TEST_CC.

This fixes BZ #33310.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
This commit is contained in:
H.J. Lu 2025-08-22 15:56:27 -07:00
parent dd4394b249
commit ee06d98c5b
3 changed files with 9 additions and 6 deletions

View File

@ -26,6 +26,8 @@ check xcheck test:
config-cflags-mprefer-vector-width="$(test-config-cflags-mprefer-vector-width)" \
config-cflags-signaling-nans="$(test-config-cflags-signaling-nans)" \
config-cflags-wno-ignored-attributes="$(test-config-cflags-wno-ignored-attributes)" \
cc-option-wfree-labels="$(test-cc-option-wfree-labels)" \
cc-option-wmissing-parameter-name="$(test-cc-option-wmissing-parameter-name)" \
enable-cet="$(test-enable-cet)" \
have-mamx-tile="$(test-have-mamx-tile)" \
have-static-pie="$(test-have-static-pie)" \

8
configure vendored
View File

@ -649,8 +649,6 @@ have_selinux
have_libcap
have_libaudit
LIBGD
libc_cv_test_cc_wmissing_parameter_name
libc_cv_test_cc_wfree_labels
libc_cv_test_cc_wimplicit_fallthrough
libc_cv_cc_loop_to_function
libc_cv_test_cc_signaling_nans
@ -8086,7 +8084,8 @@ fi
config_vars="$config_vars
cc-option-wfree-labels = $libc_cv_cc_wfree_labels"
config_vars="$config_vars
test-cc-option-wfree-labels = $libc_cv_test_cc_wfree_labels"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wmissing-parameter-name" >&5
@ -8146,7 +8145,8 @@ fi
config_vars="$config_vars
cc-option-wmissing-parameter-name = $libc_cv_cc_wmissing_parameter_name"
config_vars="$config_vars
test-cc-option-wmissing-parameter-name = $libc_cv_test_cc_wmissing_parameter_name"
conftest_code="
void bar (void (*callback) (void));

View File

@ -1611,7 +1611,7 @@ LIBC_TRY_CC_AND_TEST_CC_OPTION([for -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)
LIBC_CONFIG_VAR([test-cc-option-wfree-labels], [$libc_cv_test_cc_wfree_labels])
LIBC_TRY_CC_AND_TEST_CC_OPTION([for -Wmissing-parameter-name],
[-Werror -Wmissing-parameter-name],
@ -1623,7 +1623,8 @@ LIBC_TRY_CC_AND_TEST_CC_OPTION([for -Wmissing-parameter-name],
[libc_cv_test_cc_wmissing_parameter_name=])
LIBC_CONFIG_VAR([cc-option-wmissing-parameter-name],
[$libc_cv_cc_wmissing_parameter_name])
AC_SUBST(libc_cv_test_cc_wmissing_parameter_name)
LIBC_CONFIG_VAR([test-cc-option-wmissing-parameter-name],
[$libc_cv_test_cc_wmissing_parameter_name])
conftest_code="
void bar (void (*callback) (void));