aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-12-23 05:12:02 +0800
committerH.J. Lu <hjl.tools@gmail.com>2024-12-23 06:28:55 +0800
commit31c47126f4b5203eb5f72bb9dc8ceb09cacb4574 (patch)
tree30eea4636d6980d7ad7c13f8ff48926d582689e3 /configure
parentcb74bafbb51ba291676ab7ed3b690a47ffebc567 (diff)
downloadglibc-31c47126f4b5203eb5f72bb9dc8ceb09cacb4574.tar.xz
glibc-31c47126f4b5203eb5f72bb9dc8ceb09cacb4574.zip
string: Suppress Clang warnings on tester.c
Add a configure check for -Wno-fortify-source to suppress Clang warnings on string/tester.c, like: tester.c:385:10: error: 'strncat' size argument is too large; destination buffer has size 50, but size argument is 99 [-Werror,-Wfortify-source] 385 | check (strncat (one, "lmn", 99) == one, 1); /* Returned value. */ Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure34
1 files changed, 34 insertions, 0 deletions
diff --git a/configure b/configure
index 5fb41410e3..99a162629f 100755
--- a/configure
+++ b/configure
@@ -8003,6 +8003,40 @@ test-config-cflags-wno-restrict = $libc_cv_test_cflags_wno_restrict"
saved_CC="$CC"
CC="$TEST_CC"
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking -Wno-fortify-source in testing" >&5
+printf %s "checking -Wno-fortify-source in testing... " >&6; }
+if test ${libc_cv_test_cflags_wno_fortify_source+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if { ac_try='${CC-cc} -c -Werror -Wno-fortify-source -xc /dev/null -S -o /dev/null'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+then :
+ libc_cv_test_cflags_wno_fortify_source=-Wno-fortify-source
+else case e in #(
+ e) libc_cv_test_cflags_wno_fortify_source=
+ ;;
+esac
+fi ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_test_cflags_wno_fortify_source" >&5
+printf "%s\n" "$libc_cv_test_cflags_wno_fortify_source" >&6; }
+
+CC="$saved_CC"
+
+
+config_vars="$config_vars
+test-config-cflags-wno-fortify-source = $libc_cv_test_cflags_wno_fortify_source"
+
+
+
+saved_CC="$CC"
+CC="$TEST_CC"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking -finput-charset=ascii in testing" >&5
printf %s "checking -finput-charset=ascii in testing... " >&6; }
if test ${libc_cv_test_cflags_finput_charset_ascii+y}