From 2271e0d2b606637870daa2a39894eb8d8bbfe5dc Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 27 Jul 2023 15:49:52 -0300 Subject: Check if TEST_CC supports -Wno-restrict before using it Check if TEST_CC supports -Wno-restrict before using it to avoid Clang error: error: unknown warning option '-Wno-restrict' [-Werror,-Wunknown-warning-option] Signed-off-by: H.J. Lu Reviewed-by: Sam James --- libio/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libio') diff --git a/libio/Makefile b/libio/Makefile index 4370152964..a879e8c2ba 100644 --- a/libio/Makefile +++ b/libio/Makefile @@ -250,8 +250,10 @@ CFLAGS-tst-bz24153.c += $(no-fortify-source) CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\" # These test cases intentionally use overlapping arguments -CFLAGS-tst-sprintf-ub.c += -Wno-restrict $(no-fortify-source) -CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict $(no-fortify-source) +CFLAGS-tst-sprintf-ub.c += $(test-config-cflags-wno-restrict) \ + $(no-fortify-source) +CFLAGS-tst-sprintf-chk-ub.c += $(test-config-cflags-wno-restrict) \ + $(no-fortify-source) LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map -- cgit v1.2.3