From: Sam Ravnborg <sam@ravnborg.org>
To: Christopher Li <sparse@chrisli.org>
Cc: "Robert P. J. Day" <rpjday@crashcourse.ca>,
sparse <linux-sparse@vger.kernel.org>
Subject: Re: Detect unused header files?
Date: Thu, 30 Jul 2009 22:36:33 +0200 [thread overview]
Message-ID: <20090730203633.GA28838@merkur.ravnborg.org> (raw)
In-Reply-To: <70318cbf0907300355h5cb34671ha452433c4e0b5324@mail.gmail.com>
On Thu, Jul 30, 2009 at 03:55:46AM -0700, Christopher Li wrote:
> Hi Sam,
>
> I create a branch "unused-include-files" for some experiment patch.
> Some thing quick and dirty to find out what works and what doesn't.
> No where near submitting quality.
>
> http://git.kernel.org/?p=devel/sparse/chrisl/sparse.git;a=shortlog;h=unused-include-files
>
> Currently it just report all unused stream.
>
> for your example foo.h:
>
> #include <linux/types.h>
> #include <linux/string.h>
>
> struct foo {
> __u32 bar;
> __u32 baz;
> };
>
>
> $ ./sparse foo.h
> unused stream preprocessor(1)
> unused stream foo.h(2)
> unused stream preprocessor(3)
> unused stream /usr/include/linux/stddef.h(6)
> unused stream /usr/include/asm/posix_types.h(7)
> unused stream /usr/include/asm/types.h(9)
> unused stream /usr/include/linux/string.h(11)
> unused stream /usr/include/string.h(12)
> unused stream /usr/include/features.h(13)
> unused stream /usr/include/sys/cdefs.h(14)
> unused stream /usr/include/bits/wordsize.h(15)
> unused stream /usr/include/gnu/stubs.h(16)
> unused stream /usr/include/bits/wordsize.h(17)
> unused stream /usr/include/gnu/stubs-32.h(18)
> unused stream /usr/lib/gcc/x86_64-redhat-linux/4.3.0//include/stddef.h(19)
>
> Just as I expected. Lost of noise :-)
>
> BTW, use "-vstream" to show the actual symbol usage detail.
>
> Comments?
Thanks for hacking this up!
I will try it out during the weekend as work permits. Busy...
Sam
next prev parent reply other threads:[~2009-07-30 20:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-28 18:18 Detect unused header files? Sam Ravnborg
2009-07-28 20:36 ` Christopher Li
2009-07-28 20:36 ` Robert P. J. Day
2009-07-28 20:49 ` Christopher Li
2009-07-28 21:04 ` Sam Ravnborg
2009-07-28 21:38 ` Christopher Li
2009-07-30 10:55 ` Christopher Li
2009-07-30 11:12 ` Derek M Jones
2009-07-30 20:36 ` Sam Ravnborg [this message]
2009-08-04 21:49 ` Christopher Li
2009-08-05 6:12 ` Sam Ravnborg
2009-08-06 11:14 ` Marko Kreen
2009-08-06 11:17 ` Robert P. J. Day
2009-08-06 12:16 ` Kamil Dudka
2009-08-06 12:15 ` Robert P. J. Day
2009-08-06 13:01 ` Kamil Dudka
2009-08-06 13:26 ` Michael Stefaniuc
2009-08-06 14:09 ` Robert P. J. Day
2009-08-06 17:39 ` Christopher Li
2009-07-28 20:58 ` Sam Ravnborg
2009-07-28 21:21 ` Christopher Li
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=20090730203633.GA28838@merkur.ravnborg.org \
--to=sam@ravnborg.org \
--cc=linux-sparse@vger.kernel.org \
--cc=rpjday@crashcourse.ca \
--cc=sparse@chrisli.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).