From: Nathan Chancellor <nathan@kernel.org>
To: Pat Somaru <patso@likewhatevs.io>
Cc: nicolas@fjasle.eu, linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] scripts: Add check-build-warnings.pl for tracking kernel build warnings
Date: Fri, 17 Oct 2025 22:22:14 +0100 [thread overview]
Message-ID: <20251017212214.GA2776486@ax162> (raw)
In-Reply-To: <20251017170354.2660704-1-patso@likewhatevs.io>
Hi Pat,
On Fri, Oct 17, 2025 at 01:03:54PM -0400, Pat Somaru wrote:
> Add scripts/check-build-warnings.pl to automate the guidance in
> Documentation/process/maintainer-netdev.rst regarding new-warning-free
> code submissions. The netdev maintainers require that patches do not
> introduce new compiler warnings, and this script provides an
> automated/fool-proof way to do this with paste-into-commit-msg friendly
> output. This is not so much for netdev (which has it's own out-of-tree
> automation for this) but for folks who want to apply that bar to their
> contributions elsewhere and to have an easy way to communicate that with
> reviewers.
>
> This script builds the kernel with specified targets and warning levels,
> saving warnings as baselines that can be checked against later builds to
> detect newly introduced warnings. This allows developers to easily
> verify their changes don't add new warnings before submitting patches.
>
> Key features:
> - Automatic baseline creation and comparison per-target and
> per-warning-level
> - Warning files stored alongside build artifacts (like .cmd files)
> - CONFIG_WERROR automatically disabled to capture warnings without build
> failure
> - Support for W=1, W=2, W=3 extra warning levels
> - Clean by default to ensure all warnings are captured (not just changed
> files)
> - Optional --no-clean for faster iterative development
>
> Usage examples:
> # Save initial baseline for a driver
> scripts/check-build-warnings.pl --save-baseline drivers/net/ethernet/intel/
>
> # Check for new warnings after making changes
> scripts/check-build-warnings.pl --check drivers/net/ethernet/intel/
>
> # Use stricter W=1 warnings (separate baseline)
> scripts/check-build-warnings.pl --save-baseline --warn=1 drivers/net/
I don't know Perl so I cannot really review this but I do not see why
developers cannot just use 'make -s' and/or W=e (to set -Werror) to make
sure their code is warning free? I guess it could be helpful if there
are a lot of additional existing warnings in the code being modified but
those should be fixed, not just ignored.
Cheers,
Nathan
prev parent reply other threads:[~2025-10-17 21:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 17:03 [PATCH] scripts: Add check-build-warnings.pl for tracking kernel build warnings Pat Somaru
2025-10-17 21:22 ` Nathan Chancellor [this message]
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=20251017212214.GA2776486@ax162 \
--to=nathan@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=nicolas@fjasle.eu \
--cc=patso@likewhatevs.io \
/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;
as well as URLs for NNTP newsgroup(s).