diff options
author | Uday Shankar <ushankar@purestorage.com> | 2025-04-29 16:41:03 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2025-05-05 16:54:52 -0600 |
commit | 3d6ee575d0d49be35dbb787db4d05bdf94e2cdbb (patch) | |
tree | 92b3b9eed938b1f19922b4a4e70a305658bba7fc /tools | |
parent | 194df9f66db8d6f74f03c78c2ad47b74a5a8b886 (diff) |
selftests: ublk: kublk: build with -Werror iff WERROR!=0
Compiler warnings can catch bugs at compile time; thus, heeding them is
usually a good idea. Turn warnings into errors by default for the kublk
build so that anyone making changes is forced to heed them. Compiler
warnings can also sometimes produce annoying false positives, so provide
a flag WERROR that the developer can use as follows to have the build
and selftests run go through even if there are warnings:
make WERROR=0 TARGETS=ublk kselftest
Signed-off-by: Uday Shankar <ushankar@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250429-ublk_selftests-v2-1-e970b6d9e4f4@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/ublk/Makefile | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/ublk/Makefile b/tools/testing/selftests/ublk/Makefile index f34ac0bac6962..d8eb137abacdb 100644 --- a/tools/testing/selftests/ublk/Makefile +++ b/tools/testing/selftests/ublk/Makefile @@ -1,6 +1,10 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS += -O3 -Wl,-no-as-needed -Wall -I $(top_srcdir) +ifneq ($(WERROR),0) + CFLAGS += -Werror +endif + LDLIBS += -lpthread -lm -luring TEST_PROGS := test_generic_01.sh |