|Looking for header inclusion clean-up tool firstname.lastname@example.org (Walter Prager) (1998-08-10)|
|Re: Looking for header inclusion clean-up tool email@example.com (Michael Lam) (1998-08-13)|
|Re: Looking for header inclusion clean-up tool firstname.lastname@example.org (1998-08-13)|
|Re: Looking for header inclusion clean-up tool email@example.com (1998-08-13)|
|Re: Looking for header inclusion clean-up tool firstname.lastname@example.org (Martin Ambuhl) (1998-08-16)|
|From:||email@example.com (Dave Hansen)|
|Date:||13 Aug 1998 22:02:10 -0400|
|Organization:||B-Tree Systems, Inc.|
On 10 Aug 1998 23:18:20 -0400, Walter Prager
>Has anyone out there heard of a tool which would assist in cleaning-up
>header inclusion? I.e. something that goes off, works for a few hours
>(days?) then produces a list of which #include's are not necessary.
PC-lint from Gimpel software almost does this. When you lint a file,
it will provide you a list of files that were included, but none of
whose definitions or declarations were used.
It's not foolproof, however. In the simplified (and contrived)
example below, some of the definitions in a.h require values defined
in b.h, so a.h #include's b.h. E.g.:
typedef unsigned char Byte;
#define MSG "Hello World"
#define Flip(b) (Byte)(~(b))
In this example, PC-lint will complain that b.h was included, but
never used. Which is true, I guess. PC-lint would not make this
complaint if main.c were to use the Flip macro.
However, I've always been quite pleased with PC-lint, and am always
willing to praise it. I speak as a happy customer, with no link to
Return to the
Search the comp.compilers archives again.