Re: Detect unused header files?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 28, 2009 at 1:58 PM, Sam Ravnborg<sam@xxxxxxxxxxxx> wrote:
> Would be great...
> If you can give some general into I can maybe give
> it a shot albeit I have only very limited sprase
> hacking knowledge.

I think the starting point is lookup_symbol().
Currently lookup_symbol does not care about where is
this symbol used. There is "sym->used" already. But it does
not help much in this case because sym->used did not distingish
the usage from the same file vs from other file.  We need to add
information some how. May be one more argument for the source
of the lookup.

>
> So if we:
> - use (check/test/reference) a macro from the file => used
> - use a typedef/struct

lookup_symbol() covers all of those. But there is annoying
part as well. For example. If the same header file get include
twice, the later one will consider using the first one because
it lookup the __HEAD_FILE_NAME__ macro to avoid duplicating
include.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux