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: Bernd Strieder
Subject: Re: The g++ preprocessor: Include Guards
Date: Wed, 20 Jun 2007 14:23:04 +0200
User-agent: KNode/0.10.4

Hello,

 gutmant@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




reply via email to

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