Re: The g++ preprocessor: Include Guards

2007-06-21 Thread gutmant
On Jun 21, 3:31 pm, Bernd Strieder <[EMAIL PROTECTED]> wrote: > Hello, > > [EMAIL PROTECTED] wrote: > > On Jun 21, 10:40 am, Bernd Strieder <[EMAIL PROTECTED]> > > wrote: > > >> What I would like is a tool to find header files included > >> unnecessarily, or those with the majority of no use where

Re: The g++ preprocessor: Include Guards

2007-06-21 Thread Bernd Strieder
Hello, [EMAIL PROTECTED] wrote: > On Jun 21, 10:40 am, Bernd Strieder <[EMAIL PROTECTED]> > wrote: >> >> What I would like is a tool to find header files included >> unnecessarily, or those with the majority of no use where included. >> But this requires parsing, since it has to do even more tha

Re: The g++ preprocessor: Include Guards

2007-06-21 Thread gutmant
On Jun 21, 10:40 am, Bernd Strieder <[EMAIL PROTECTED]> wrote: > Hello, > > [EMAIL PROTECTED] wrote: > > What I need is to build (script wise) a reliable inclusion tree. > > I already have the code (py) to do that, but that relies on the > > preprocessor's output, so the result ends up partial. >

Re: The g++ preprocessor: Include Guards

2007-06-21 Thread Bernd Strieder
Hello, [EMAIL PROTECTED] wrote: > What I need is to build (script wise) a reliable inclusion tree. > I already have the code (py) to do that, but that relies on the > preprocessor's output, so the result ends up partial. > While exploring this issue, I realized that the problem is this > optimiz

Re: The g++ preprocessor: Include Guards

2007-06-20 Thread gutmant
On Jun 20, 4:16 pm, Bernd Strieder <[EMAIL PROTECTED]> wrote: > Hello, > > [EMAIL PROTECTED] wrote: > > Yes, what you suggest will work, but is impractical when you have an > > amount or code that takes hours to compile you need to fix... :/ > > I'm looking for a solution along the lines of adding

Re: The g++ preprocessor: Include Guards

2007-06-20 Thread gutmant
On Jun 20, 3:23 pm, Bernd Strieder <[EMAIL PROTECTED]> wrote: > Hello, > > > > [EMAIL PROTECTED] wrote: > > On Jun 20, 2:28 pm, Bernd Strieder <[EMAIL PROTECTED]> > > wrote: > >> Or see the section "Once-Only Headers" in the docs of cpp, the C > >> preprocessor. > > >> I think you can easily break

Re: The g++ preprocessor: Include Guards

2007-06-20 Thread gutmant
On Jun 20, 2:28 pm, Bernd Strieder <[EMAIL PROTECTED]> wrote: > Hello, > > [EMAIL PROTECTED] wrote: > > Say you have a file, a.h with an include guard. > > If you include it twice and look at the preprocessed output, you see > > there's no sign for the second inclusion. > > However, if you include

The g++ preprocessor: Include Guards

2007-06-20 Thread gutmant
Say you have a file, a.h with an include guard. If you include it twice and look at the preprocessed output, you see there's no sign for the second inclusion. However, if you include it twice - once from a relative path, and once from an absolute one - you see that the second inclusion indeed occur

Re: The g++ preprocessor: Include Guards

2007-06-20 Thread Bernd Strieder
Hello, [EMAIL PROTECTED] wrote: > Yes, what you suggest will work, but is impractical when you have an > amount or code that takes hours to compile you need to fix... :/ > I'm looking for a solution along the lines of adding a flag, or using > a different preprocessor maybe... > Do you know anyt

Re: The g++ preprocessor: Include Guards

2007-06-20 Thread Bernd Strieder
Hello, [EMAIL PROTECTED] wrote: > On Jun 20, 2:28 pm, Bernd Strieder <[EMAIL PROTECTED]> > wrote: >> Or see the section "Once-Only Headers" in the docs of cpp, the C >> preprocessor. >> >> I think you can easily break the employed heuristics to reach your >> goal. > > Thank you Bernd! > I figu

Re: The g++ preprocessor: Include Guards

2007-06-20 Thread Bernd Strieder
Hello, [EMAIL PROTECTED] wrote: > Say you have a file, a.h with an include guard. > If you include it twice and look at the preprocessed output, you see > there's no sign for the second inclusion. > However, if you include it twice - once from a relative path, and once > from an absolute one - y