summaryrefslogtreecommitdiffstats
path: root/lib/Makefile
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2024-01-30 14:12:55 -0800
committerKees Cook <keescook@chromium.org>2024-02-06 02:21:38 -0800
commit30edbdf9b98ddc9087f5f8b9a9644fa5c05fa5b1 (patch)
treeca2a60555c0217a9160f79c9f020d135e3744209 /lib/Makefile
parent167ebeda36fae4bb47ace32bcacecde7d24d2850 (diff)
downloadlinux-30edbdf9b98ddc9087f5f8b9a9644fa5c05fa5b1.tar.gz
linux-30edbdf9b98ddc9087f5f8b9a9644fa5c05fa5b1.tar.bz2
linux-30edbdf9b98ddc9087f5f8b9a9644fa5c05fa5b1.zip
ubsan: Silence W=1 warnings in self-test
Silence a handful of W=1 warnings in the UBSan selftest, which set variables without using them. For example: lib/test_ubsan.c:101:6: warning: variable 'val1' set but not used [-Wunused-but-set-variable] 101 | int val1 = 10; | ^ Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202401310423.XpCIk6KO-lkp@intel.com/ Reviewed-by: Marco Elver <elver@google.com> Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'lib/Makefile')
-rw-r--r--lib/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile
index 6b09731d8e61..bc36a5c167db 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -69,6 +69,7 @@ obj-$(CONFIG_HASH_KUNIT_TEST) += test_hash.o
obj-$(CONFIG_TEST_IDA) += test_ida.o
obj-$(CONFIG_TEST_UBSAN) += test_ubsan.o
CFLAGS_test_ubsan.o += $(call cc-disable-warning, vla)
+CFLAGS_test_ubsan.o += $(call cc-disable-warning, unused-but-set-variable)
UBSAN_SANITIZE_test_ubsan.o := y
obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o
obj-$(CONFIG_TEST_LIST_SORT) += test_list_sort.o