Linux-Sparse Archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <lucvoo@kernel.org>
To: "Herbert, Marc" <marc.herbert@intel.com>
Cc: "linux-sparse@vger.kernel.org" <linux-sparse@vger.kernel.org>
Subject: Re: Christmas wish list: -Werror and -Wno-warn-about-X
Date: Sat, 20 Jan 2024 02:27:17 +0100	[thread overview]
Message-ID: <3eifvstptigzcjthdjwshxxxqtn3yjtm4jifhs4sqcsrqhozjh@6ixifzmsekkq> (raw)
In-Reply-To: <28F15CC0-6BCF-411C-8481-9EC8900B8372@intel.com>

On Fri, Jan 19, 2024 at 11:09:47PM +0000, Herbert, Marc wrote:
> 
> > Anyway, with this it was very easy to reproduce and find the cause.
> > Fixed and pushed, so mainline Sparse should be OK now.
> 
> > Many thanks for the bug report,
> 
> Fix confirmed, many thanks for the super quick fix!
> 
> It's also great to see that you seem to have more time to spend on
> sparse right now.

If only ...

> So trying to push my luck, here's the number 1 item on
> my "Christmas Wish List": a combination of -Werror and -Wno-warn-about-X
> options that would provides finer-grained and generally better control
> on the exit status and output. After maintaining sparse automation for
> many months, this is I think what would lower the CI adoption bar the
> most.

Yes, I can understand that.

As far as I understand it, -Werror has been replaced by -Wsparse-error in
2014 because sparse was mainly used with exactly the same options as the
ones used for the compiler (which is good), there was too much error
messages and people didn't want to have their build to fail (see commits
4d8811879a1c & fe57afa0b44a). So, essentially the exact opposite of what
you would like :(

-Wsparse-error is really a pain because it also turn every warning into
an error (and then exit on these errors).

It should indeed be possible to have an exit(1) on errors but I'm very wary
of changing the current behaviour. What about something like -ffail-on-error?

> So far we've been using a brittle script that captures the incredibly
> verbose and mostly unusable output (mostly due to some hard-to-fix
> warnings located in common .h files) and "post-processes" it
> with... "grep".
>  https://github.com/thesofproject/sof/commit/b7708182fbe5d
> 
> I'm curious how people typically automate runnning sparse on the
> Linux kernel. Does everyone "greps" logs too? Or is it more like
> `$(wc -l) == 0`?

I think so (but I could be very wrong). An exit on error is only useful
if the output is clean and the errors not too frequent. I think it's
often not the case.

But, if your main problem is with error messages concerning address spaces,
have you tried to simply use -Wno-address-space?

Some other error messages issued by sparse can't be disabled but most of these
are, I think, parsing or typing errors that are more or less unrecoverable.

Purely for my own curiosity, could you send me one of your log of sparse
errors?

Best regards,
-- Luc

      reply	other threads:[~2024-01-20  1:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6A3A9274-C059-467A-89A8-54815D5461BC@intel.com>
2023-12-27  8:00 ` Infinite loop in delete_pseudo_user_list_entry() bisected to commit "cast: optimize away casts to/from pointers" Herbert, Marc
2023-12-27 23:46   ` Luc Van Oostenryck
2023-12-28  1:08     ` Herbert, Marc
2023-12-28 14:21       ` Luc Van Oostenryck
2024-01-19 23:09         ` Christmas wish list: -Werror and -Wno-warn-about-X Herbert, Marc
2024-01-20  1:27           ` Luc Van Oostenryck [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=3eifvstptigzcjthdjwshxxxqtn3yjtm4jifhs4sqcsrqhozjh@6ixifzmsekkq \
    --to=lucvoo@kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=marc.herbert@intel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).