[cfe-commits] r63764 - in /cfe/trunk: lib/Lex/PPDirectives.cpp test/Preprocessor/include-directive1.c test/Preprocessor/include-directive3.c

Chris Lattner clattner at apple.com
Wed Feb 4 13:22:03 PST 2009


On Feb 4, 2009, at 1:06 PM, Daniel Dunbar wrote:

> I don't think this is correct; I believe the -include searches
> relative to the current working directory, not the main file.
> --
> ddunbar at milton:tmp$ mkdir x
> ddunbar at milton:tmp$ touch x/a.h
> ddunbar at milton:tmp$ mkdir y
> ddunbar at milton:tmp$ touch y/a.c
> ddunbar at milton:tmp$ gcc -fsyntax-only -include x/a.h y/a.c
> ddunbar at milton:tmp$ clang -fsyntax-only -include x/a.h y/a.c
> <predefines>:90:10: error: 'x/a.h' file not found
> #include "x/a.h"
>         ^
> 1 diagnostic generated.
> --
>
> Would it be terrible to give the predefines buffer a file entry, with
> the path being the current working directory? This would also allow
> things in the predefines buffer to have a valid source location...

Is this something that is needed in practice for something important?

-Chris



More information about the cfe-commits mailing list