linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dan Carpenter" <error27@gmail.com>
To: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
Cc: Sam Ravnborg <sam@ravnborg.org>,
	smatch-discuss@lists.sf.net, linux-sparse@vger.kernel.org
Subject: Re: Moving smatch to use sparse
Date: Thu, 5 Oct 2006 23:31:14 -0700	[thread overview]
Message-ID: <a63d67fe0610052331y4e914869k7c0feaf42bb8b14c@mail.gmail.com> (raw)
In-Reply-To: <20061005102542.GD23093@wohnheim.fh-wedel.de>

On 10/5/06, Jörn Engel <joern@wohnheim.fh-wedel.de> wrote:
>
> One advantage over gcc or plain sparse is that code checking can be
> done in two passes.  Pass one collects all sorts of information for
> every compilation unit.  Pass two can then combine the information for
> all compilation units and do global checking of some sort.
>
> For example, the currently debated "may be used uninitialized" warning
> in gcc is simply not able to detect something like:
>
> foo.c:
>         int foo;
>         do_initialize(&foo);
>         do_something(foo);
> bar.c:
> void do_initialize(int *bar)
> {
>         *bar = 0;
> }
>
> The code is 100% correct, but gcc only looks at foo.c and spits out a
> warning.  Smatch can do better than that - if someone writes a
> checker.
>
> Jörn
>

Actually, I think gcc handles that specific example correctly...  If
do_initialize() is in the same file it looks to see if it actually
initializes it or not.  If it's in a seperate file then it assumes
that it initializes it and doesn't print a warning.

I'm using gcc 4.0.3.

regards,
dan carpenter

  reply	other threads:[~2006-10-06  6:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a63d67fe0607140925h3665cd98ibc2fab07f6f80360@mail.gmail.com>
2006-07-16  0:42 ` Moving smatch to use sparse Dan Carpenter
2006-10-05  8:41   ` Dan Carpenter
2006-10-05  9:26     ` Sam Ravnborg
2006-10-05  9:49       ` Dan Carpenter
2006-10-05 10:25         ` Jörn Engel
2006-10-06  6:31           ` Dan Carpenter [this message]
2006-10-05 15:52     ` Michael Stefaniuc
2006-10-05 20:58       ` Dan Carpenter
2006-10-05 22:46         ` Michael Stefaniuc
2006-10-06  8:57           ` Dan Carpenter

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=a63d67fe0610052331y4e914869k7c0feaf42bb8b14c@mail.gmail.com \
    --to=error27@gmail.com \
    --cc=joern@wohnheim.fh-wedel.de \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=smatch-discuss@lists.sf.net \
    /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).