Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > dependency checking

Reply
Thread Tools

dependency checking

 
 
Weiguang Shi
Guest
Posts: n/a
 
      06-21-2006
Hi,

Is there already a tool that goes through a C source file and reports
the header files that the source file does not depends on and those
they do?

This becomes handy in a project that has many source and header files
and where changes are frequent.

Thank you.
Wei
 
Reply With Quote
 
 
 
 
Michael Mair
Guest
Posts: n/a
 
      06-21-2006
Weiguang Shi schrieb:
> Is there already a tool that goes through a C source file and reports
> the header files that the source file does not depends on and those
> they do?


This is not on-topic in comp.lang.c.
<OT>
Some compilers and IDEs generate include dependency information,
some improved forms of this; ask in a newsgroup (or whatever is
appropriate) for your compiler/IDE.
Apart from that, have a look at PC-lint/FlexeLint -- it can help
you find unnecessary includes, see for example
http://www.gimpel.com/html/techfaq.htm#q16
</OT>

> This becomes handy in a project that has many source and header files
> and where changes are frequent.


A project which changes that frequently in its dependencies
likely suffers from bad design.
I am aware that unnecessary includes can clog your source and
have suffered from badly maintained source like that.
<OT>
Back then, it was not very hard to write some script to utilise
the weak dependency information from gcc -- it dumbly tried to
compile source files with one include directive at a time
removed.
</OT>
However, replacing _all_ "superfluous" headers does not work
very well. Consider:
#include "foo.h"
#include "bar.h"
where "foo.h" includes "bar.h" as well and where the original
#include "bar.h"
is intended to give "visible evidence" of that and make sure
that bar.h is included even if foo.h were to change at some
point in the future.

Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
favourite tool for dependency checking? (e.g. Genjar) Alex Hunsley Java 0 05-03-2006 10:06 AM
Build tools: dependency checking, Ant and Javamake Karsten Wutzke Java 3 06-05-2005 05:01 AM
ModelSim - vcom dependency order andyesquire@hotmail.com VHDL 17 04-06-2005 06:08 PM
Re: dependency checking with ant sowbug Java 0 08-19-2003 01:53 PM
Help untaining the command. Insecure dependency in `` ... setuid danpres2k Perl 0 08-13-2003 03:21 PM



Advertisments