aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
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.ac
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.ac')
-rw-r--r--configure.ac10
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 8c2eecf9a6..a535a09de8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1589,6 +1589,16 @@ LIBC_TRY_TEST_CC_OPTION([-Wno-restrict],
LIBC_CONFIG_VAR([test-config-cflags-wno-restrict],
[$libc_cv_test_cflags_wno_restrict])
+dnl Check if TEST_CC supports -Wno-fortify-source.
+LIBC_TRY_TEST_CC_OPTION([-Wno-fortify-source],
+ [-c -Werror -Wno-fortify-source],
+ libc_cv_test_cflags_wno_fortify_source,
+ [libc_cv_test_cflags_wno_fortify_source=-Wno-fortify-source],
+ [libc_cv_test_cflags_wno_fortify_source=]
+)
+LIBC_CONFIG_VAR([test-config-cflags-wno-fortify-source],
+ [$libc_cv_test_cflags_wno_fortify_source])
+
dnl Check if TEST_CC supports -finput-charset=ascii.
LIBC_TRY_TEST_CC_OPTION([-finput-charset=ascii],
[-c -Werror -finput-charset=ascii],