linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Stefaniuc <mstefani@redhat.com>
To: Josh Triplett <josh@freedesktop.org>
Cc: linux-sparse@vger.kernel.org
Subject: Running sparse on the Wine code (Was: Re: Ignore the cdecl and stdcall attributes for now.)
Date: Wed, 23 May 2007 01:44:13 +0200	[thread overview]
Message-ID: <4653804D.3040306@redhat.com> (raw)
In-Reply-To: <46535373.3020109@freedesktop.org>

Josh Triplett wrote:
> Michael Stefaniuc wrote:
>> Josh Triplett wrote:
>>> Don't pass -Wall to sparse unless you really mean it.  cgcc filters it out for
>>> a reason; just because you have -Wall in CFLAGS for GCC doesn't mean you want
>>> -Wall for sparse.  Sparse -Wall includes some warnings with high false
>>> positive rates that you probably don't want.
>> Ok good to know. I went the easy way just duplicating the gcc command 
>> line and replacing gcc with sparse and adding -D__i386___ as Wine won't 
>> build without a processor type defined.
> 
> cgcc will define the processor type too.
> 
> I highly recommend trying a build with CC=cgcc.  You can then pass sparse
> flags in CFLAGS, and cgcc will filter them out before calling CC; you can
> also specify CHECK="sparse -Wfoo -Wno-bar" if you prefer not to change
> CFLAGS.
Hmm ... somehow i have confused cgcc with the code generating backend
that Jeff Garzik planned to write for sparse. With cgcc i won't need my
Wine build hack anymore and makes things even easier for me.

>> I'm still trying to figure out 
>> if sparse is useful (signal to noise ratio) for Wine.
> 
> It will likely take some time and Sparse modifications in order to parse
> Wine; however, I want Sparse to handle as much code as it can, not just
With cgcc Wine builds just fine (I didn't try yet the configure and make
depend stage of the build process). The only nitpick is that the ccache
cache from a normal build isn't valid anymore for the CC=cgcc run. I'll
have a look into it the next time i'll have to wait for the build to finish.

> Linux.  I appreciate you trying it on Wine; I think working on this will
> help both Wine and Sparse.
> 
>> Wine has some 
>> constraints (having to follow an existing old grown API; compatibility 
>> with other C processors on non Linux OSes) that aren't a burden for the 
>> Linux Kernel. E.g. a patch to move to C99 struct initializer was 
>> recently rejected due to compatibility concerns with other C compilers.
> 
> I just committed support for a -Wno-old-initializer flag to turn off the
> sparse warning on non-C99 initializers.
That was fast and I didn't even request it :)

>>> The undefined preprocessor identifiers from limits.h come from not using cgcc,
>>> which defines them.  Sparse should ideally define those itself.  You can work
>>> around the problem by using cgcc or by defining the symbols on the sparse
>>> command line as cgcc does.
>> I'll do a run with cgcc tonight instead of sparse and check the difference.
Updated
http://people.redhat.com/mstefani/wine/download/wine+sparse-make.output.bz2
That is the result of:
make clean; CHECK='sparse -Wno-transparent-union -Wno-old-initializer'
make CC=cgcc > make.out 2>&1
The output is with latest git sparse including the fix for the typedefs
to functions with a stdcall attribute.
I didn't look at the output yet as it is past bed time around here.

bye
	michael
-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani@redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart

  reply	other threads:[~2007-05-22 23:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-15 22:05 Ignore the cdecl and stdcall attributes for now Michael Stefaniuc
2007-05-16  6:32 ` Josh Triplett
2007-05-16 11:19   ` Michael Stefaniuc
2007-05-16 12:46     ` Sam Ravnborg
2007-05-22 22:39     ` Josh Triplett
     [not found]   ` <46520647.9090802@redhat.com>
     [not found]     ` <4652819D.4040101@freedesktop.org>
2007-05-22 14:41       ` Michael Stefaniuc
2007-05-22 20:32         ` Josh Triplett
2007-05-22 23:44           ` Michael Stefaniuc [this message]
2007-05-23  2:01             ` Running sparse on the Wine code (Was: Re: Ignore the cdecl and stdcall attributes for now.) Josh Triplett

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=4653804D.3040306@redhat.com \
    --to=mstefani@redhat.com \
    --cc=josh@freedesktop.org \
    --cc=linux-sparse@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).