473,406 Members | 2,769 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,406 software developers and data experts.

Finding Header dependencies

I'm currently using MSVC.Net 2003. My task is to extract header dependencies
from C++ source code. To that end, I invoke "cl /E" and parse the
preprocessor output. While this approach is effective, it is quite slow.
The runtime of this command is so similar to actually compiling a file that
I'm guessing it really is compiled even though no output is created. Can
anyone answer a few questions about how cl performs preprocessing?

1) Are there any command line switches I should add or avoid in order to
reduce cl's work to the bare minimum required for preprocessing?

2) Would the pre-processing performance improve if I switched to VC 2005?

3) Is there some other tool or method that would give me this information in
a more efficient manner?

Thanks for your time,
Justin
Oct 16 '06 #1
2 1212

"Justin T. Gibbs" <Justin T. Gi***@discussions.microsoft.comwrote in
message news:AB**********************************@microsof t.com...
I'm currently using MSVC.Net 2003. My task is to extract header
dependencies
from C++ source code. To that end, I invoke "cl /E" and parse the
preprocessor output. While this approach is effective, it is quite slow.
The runtime of this command is so similar to actually compiling a file
that
I'm guessing it really is compiled even though no output is created. Can
anyone answer a few questions about how cl performs preprocessing?

1) Are there any command line switches I should add or avoid in order to
reduce cl's work to the bare minimum required for preprocessing?

2) Would the pre-processing performance improve if I switched to VC 2005?

3) Is there some other tool or method that would give me this information
in
a more efficient manner?
gcc -MMD
or
makedep http://sourceforge.net/projects/makedep

>
Thanks for your time,
Justin

Oct 17 '06 #2
gcc -MMD
or
makedep http://sourceforge.net/projects/makedep
Yes, gcc would be much faster, but gcc doesn't have all of the built in
preprocessor definitions that cl has- definitions that may impact the headers
that are included. I could perform an analysis to on what flags are defined
for which options, and carefully pass those to gcc, but that would make my
solution much more difficult to maintain.

--
Justin
Oct 17 '06 #3

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

Similar topics

11
by: Steven T. Hatton | last post by:
In the past there have been lengthy discussiions regarding the role of header files in C++. People have been very adamat about header files serving as in interface to the implementation. I do...
6
by: Johannes Bauer | last post by:
Hi group, I've got a question concerning inclusion of .hpp files. Currently I'm including all needed header files in the .cpp file. This means all dependencies of the package and all...
3
by: Code4u | last post by:
We have a mature project that suffers long build times because many modules pull in far more than they need. In the long term I would like to refactor to break some of the dependencies, but I would...
60
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header...
3
by: fc2004 | last post by:
Hi, Is there any tools that could report where cyclic header dependency happens? this would be useful when working with a large project where tens or hundreds of headers files may form complex...
12
by: Ben | last post by:
I'm kind of new to creating templates. I've made some small class and function templates in the past and I have used quite of bit of the STL, but I am having problems tyring to create templates. ...
6
by: DaTurk | last post by:
Hi, I'm a bit rusty with the wonderful language of c++. I worked with it, maybe 6 or 7 years ago and now I need to knock the dust off. But I was perusing some code when I noticed that this one...
8
by: Rob Cakebread | last post by:
Hi, I need to find external dependencies for modules (not Python standard library imports). Currently I use pylint and manually scan the output, which is very nice, or use pylint's...
9
by: Andrew | last post by:
Hi, I see some people prefer to use in headers (where possible) class declaration: // B.h class A; class B {
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.