This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: #include_next: wrong search order?


Hi Eljay,

On Friday 04 March 2005 16:20, Eljay Love-Jensen wrote:
>  >Please re-read the quote from the 'info cpp': cpp should have 
>  >started the search with the directory _after_ the one containing 
>  >syslimits.h 
> 
> I did read it, and that appears to be exactly what is happening in 
> your example.

Nope, you're wrong:

> [1] Your y.c source
> [2] <gcc-include-dir>/limits.h starts
> [3] <gcc-include-dir>/limits.h about to include a new file
> [4] <gcc-include-dir>/syslimits.h starts-and-completes

syslimits.h doesn't start and complete: it does
"#include_next <limits.h>" instead. Therefore here should be:

[4] <gcc-include-dir>/syslimits.h starts
[5] <gcc-include-dir>/syslimits.h about to #include_next <limits.h>
[6] /usr/include/limits.h starts
[7] /usr/include/limits.h completes
[8] <gcc-include-dir>/syslimits.h completes
[9] <gcc-include-dir>/limits.h completes

Instead, this happens

[4] <gcc-include-dir>/syslimits.h starts
[5] <gcc-include-dir>/syslimits.h about to #include_next <limits.h>
[6] <gcc-include-dir>/limits.h starts
[7] <gcc-include-dir>/limits.h about to #include_next <limits.h>
[8] /usr/include/limits.h starts
[9] /usr/include/limits.h completes
[10] <gcc-include-dir>/limits.h completes
[11] <gcc-include-dir>/syslimits.h completes
[12] <gcc-include-dir>/limits.h completes

Why?

Alexey.

-- 
Don't be afraid of love.
Are you afraid of love?
                        -- Pkunks, SC2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]