help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The g++ preprocessor: Include Guards


From: gutmant
Subject: Re: The g++ preprocessor: Include Guards
Date: Wed, 20 Jun 2007 13:04:24 -0000
User-agent: G2/1.0

On Jun 20, 3:23 pm, Bernd Strieder <strie...@informatik.uni-kl.de>
wrote:
> Hello,
>
>
>
>  gutm...@gmail.com wrote:
> > On Jun 20, 2:28 pm, Bernd Strieder <strie...@informatik.uni-kl.de>
> > 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 figured as much. I still don't understand how I can make the
> > preprocessor NOT to employ the optimization.
> > I agree it is indeed and important one for most practical needs, but
> > as the moment I need the information that is withheld from me...
> > Thank you very much again,
> >  - Tali
>
> According to the docs the optimization is used, if the whole header file
> besides comments is contained within #ifndef...#endif, which is a
> really simple heuristic to implement: just test, whether the first
> non-comment thing is #ifndef. So put something before, some #define,
> some #include or whatever, and the optimization should be turned off
> for the path name the header file is read from.
>
> Bernd Strieder

Hi Bernd,
Thanks again :)
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 anything like that?
 Thanks,
- Tali



reply via email to

[Prev in Thread] Current Thread [Next in Thread]