public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Uday Shankar <ushankar@purestorage.com>
Cc: Shuah Khan <shuah@kernel.org>,
	linux-block@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] selftests: ublk: kublk: build with -Werror iff WERROR!=0
Date: Wed, 30 Apr 2025 08:09:13 +0800	[thread overview]
Message-ID: <aBFqKZFAqwc5dEYl@fedora> (raw)
In-Reply-To: <20250429-ublk_selftests-v2-1-e970b6d9e4f4@purestorage.com>

On Tue, Apr 29, 2025 at 04:41:03PM -0600, Uday Shankar wrote:
> 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

I thought WERROR is 0 default, but actually the default value is 1.

Just tried gcc 14/15 and clang 18/20, looks everything works fine.

For kernel selftests, I guess the usual way is to do it explicitly
by passing 'make -C tools/testing/selftests TARGETS=ublk'.

Even though the build fails for people who is running the test on purpose,
or doling whole kernel selfests, they still can:

- report the failure

- skip ublk test by adding 'SKIP_TARGETS=ublk' to command line

Also this ways has been used by perf, lib/api, lib/subcmd and lib/sysmbol in
linux kernel tools/, so I feel the change should be doable, but let Jens decide
if it is fine to pass -Werror at default:

Reviewed-by: Ming Lei <ming.lei@redhat.com>

Otherwise, it still can be enabled conditionally with default off.


Thanks,
Ming


  reply	other threads:[~2025-04-30  0:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-29 22:41 [PATCH v2 0/3] selftests: ublk: more misc fixes Uday Shankar
2025-04-29 22:41 ` [PATCH v2 1/3] selftests: ublk: kublk: build with -Werror iff WERROR!=0 Uday Shankar
2025-04-30  0:09   ` Ming Lei [this message]
2025-04-29 22:41 ` [PATCH v2 2/3] selftests: ublk: make test_generic_06 silent on success Uday Shankar
2025-04-29 22:41 ` [PATCH v2 3/3] selftests: ublk: kublk: fix include path Uday Shankar
2025-05-05 22:55 ` [PATCH v2 0/3] selftests: ublk: more misc fixes Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aBFqKZFAqwc5dEYl@fedora \
    --to=ming.lei@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=ushankar@purestorage.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox