This is the mail archive of the gcc@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]

Is this correct? (contradicting includes)


Hi!
I was hit by this:
$ cat Old/i1.h
#include "i2.h"

$ cat Old/i2.h
#define A OLD

$ cat New/i2.h
#define A NEW

$ cat t.c
#include "i1.h"
A
#undef A
#include "i2.h"
A

(There is *no* New/i1.h file)

$ gcc -E -I New -I Old t.c
# 1 "t.c"
# 1 "Old/i1.h" 1
# 1 "Old/i2.h" 1
# 2 "Old/i1.h" 2
# 2 "t.c" 2
OLD

# 1 "New/i2.h" 1
# 5 "t.c" 2
NEW


We use cvs for our project. If we do not check out everything, the missing
peaces are found inside a completely checked out up to date dir (which is Old
in this example). So if we check out header file i2.h *only*,
it is not used at all.

How is it meant to work? Is there a general rule, how cpp finds its headers?

Thanks,
Martin.

-- 
The early bird catches the worm. If you want something else for       
breakfast, get up later.


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