473,387 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

dependency checking

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
Jun 21 '06 #1
1 1343
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.
Jun 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Doug | last post by:
Hello, We are having a problem with a component in our system that uses publisher policy files. Whenever it gets modified and moved out to where our build processes reference components for other...
1
by: James Edwards | last post by:
There seems to be a bug in the link-library dependency checking in VS.NET 2003. Under the Configuration->Linker->General->Additional Library Directories property, if you specify a directory name...
5
by: Jay A. Moritz | last post by:
Error: The dependency '<my dll>' in project '<my project>' cannot be copied to the run directory because it would conflict with dependency '<my dll>'. I am getting a dependency error building...
3
by: DJTN | last post by:
I'm getting the following error when I try to compile my setup project in VS 2002. I have re-installed the .net framework 1.1 and it didnt solve the problem. WARNING: Unable to find dependency...
9
by: Brett Romero | last post by:
I have two projects in one solution - a library and executable. Each have a namespace such as: ROOT.myapp.Functional ROOT.myapp.UI However, each cannot reference the other. myapp.UI is...
8
by: Sonali | last post by:
Hi, I am new to this group. I am working on a peice of code which is like: 1 windows class library project which needs a startup project (exe generated by other project). It references this exe...
1
by: =?Utf-8?B?SmFzb24gUmljaG1laWVy?= | last post by:
I came across a code sample in a book that I am reading that uses a dependency property. I looked at some of the documentation for dependency properties but, for some reason, the concept is not...
1
by: vincentt | last post by:
Hi, We code DLL's and so far it was done using VS6.0. We are planning to migrate the VS.NET 2005 and use the VS6 VC++ code which generated the DLL to VS 2005 VC++.NET. However we donot plan to...
0
by: =?Utf-8?B?QmVybnJkIE5vcm1pZXI=?= | last post by:
The code in question is very simple: PACL acl = 0; PACL newAcl = 0; PSECURITY_DESCRIPTOR sd = 0; DWORD res = GetNamedSecurityInfo(const_cast<char*>(path.c_str()), type,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.