From 31c47126f4b5203eb5f72bb9dc8ceb09cacb4574 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 23 Dec 2024 05:12:02 +0800 Subject: 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 Reviewed-by: Sam James --- string/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'string') diff --git a/string/Makefile b/string/Makefile index 1dff405c27..ac70d63404 100644 --- a/string/Makefile +++ b/string/Makefile @@ -252,8 +252,11 @@ endif include ../Rules -CFLAGS-inl-tester.c += -fno-builtin -CFLAGS-noinl-tester.c += -fno-builtin +CFLAGS-tester.c += $(test-config-cflags-wno-fortify-source) +CFLAGS-inl-tester.c += -fno-builtin \ + $(test-config-cflags-wno-fortify-source) +CFLAGS-noinl-tester.c += -fno-builtin \ + $(test-config-cflags-wno-fortify-source) CFLAGS-tst-strlen.c += -fno-builtin CFLAGS-stratcliff.c += -fno-builtin CFLAGS-test-ffs.c += -fno-builtin -- cgit v1.2.3