From: Dan Carpenter <dan.carpenter@oracle.com>
To: David Gow <davidgow@google.com>
Cc: Marcelo Schmitt <marcelo.schmitt1@gmail.com>,
Jonathan Corbet <corbet@lwn.net>,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Daniel Latypov <dlatypov@google.com>,
"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
linux-sparse@vger.kernel.org, cocci@inria.fr,
smatch@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Shuah Khan <skhan@linuxfoundation.org>,
julia.lawall@inria.fr
Subject: Re: [PATCH v2 2/2] Documentation: dev-tools: Enhance static analysis section with discussion
Date: Thu, 31 Mar 2022 11:14:10 +0300 [thread overview]
Message-ID: <20220331081409.GY12805@kadam> (raw)
In-Reply-To: <CABVgOSkb5CpnXDF_m7iy=A7RmN+KmY0T38TeZ4hKbmkdQgt6Yw@mail.gmail.com>
On Wed, Mar 30, 2022 at 10:48:13AM +0800, David Gow wrote:
> > +
> > +Smatch does flow analysis and, if allowed to build the function database, it
> > +also does cross function analysis. Smatch tries to answer questions like where
> > +is this buffer allocated? How big is it? Can this index be controlled by the
> > +user? Is this variable larger than that variable?
> > +
> > +It's generally easier to write checks in Smatch than it is to write checks in
> > +Sparse. Nevertheless, there are some overlaps between Sparse and Smatch checks
> > +because there is no reason for re-implementing Sparse's check in Smatch.
>
> This last sentence isn't totally clear to me. Should this "because" be "so"?
>
I stopped reading your email when you wrote "Cheers, David" but I should
have scrolled down.
There is not very much overlap between Sparse and Smatch. Both have a
warning for if (!x & y). That is a tiny thing. The big overlap is when
it comes to the locking checks. The Smatch check for locking is
honestly way better and more capable.
I always run both Sparse and Smatch on my patches. I should run
Coccinelle as well, but I'm more familiar with Sparse and Smatch.
regards,
dan carpenter
next prev parent reply other threads:[~2022-03-31 8:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-29 23:21 [PATCH v2 0/2] Add a section for static analysis tools Marcelo Schmitt
2022-03-29 23:22 ` [PATCH v2 1/2] Documentation: dev-tools: " Marcelo Schmitt
2022-03-29 23:48 ` Daniel Latypov
2022-03-30 2:33 ` David Gow
2022-03-30 8:04 ` Julia Lawall
2022-03-29 23:23 ` [PATCH v2 2/2] Documentation: dev-tools: Enhance static analysis section with discussion Marcelo Schmitt
2022-03-30 2:48 ` David Gow
2022-03-30 8:07 ` Julia Lawall
2022-03-30 19:30 ` Marcelo Schmitt
2022-04-01 0:18 ` David Gow
2022-03-31 8:14 ` Dan Carpenter [this message]
2022-04-01 0:19 ` David Gow
2022-03-30 8:06 ` Julia Lawall
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=20220331081409.GY12805@kadam \
--to=dan.carpenter@oracle.com \
--cc=cocci@inria.fr \
--cc=corbet@lwn.net \
--cc=davidgow@google.com \
--cc=dlatypov@google.com \
--cc=julia.lawall@inria.fr \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.com \
--cc=mchehab+huawei@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=smatch@vger.kernel.org \
/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).