[cfe-dev] -include <file> does not respect -I<path>

Daniel Dunbar daniel at zuster.org
Wed Apr 22 01:54:30 PDT 2009


Hi Robert,

Thanks for the report. We have this filed as PR3992:
  http://llvm.org/bugs/show_bug.cgi?id=3992

I added a workaround which fixes this particular problem here:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090420/016073.html

--
ddunbar at ozzy:foo$ touch test.c
ddunbar at ozzy:foo$ mkdir headers
ddunbar at ozzy:foo$ touch headers/test.h
ddunbar at ozzy:foo$ gcc -c test.c -I./headers -include test.h
ddunbar at ozzy:foo$ clang -c test.c -I./headers -include test.h
ddunbar at ozzy:foo$ clang -c test.c -I./headers -include test.h -E
clang: warning: argument unused during compilation: '-c'
# 1 "test.c"
# 1 "test.c" 1
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 110 "<built-in>" 3
# 110 "<command line>" 1

# 1 "./headers/test.h" 1
# 112 "<command line>" 2
# 112 "<built-in>" 2 3
# 1 "test.c" 2
--

 - Daniel

On Tue, Apr 21, 2009 at 10:25 PM, Robert Purves <listrp at gmail.com> wrote:

>
> $ touch test.c
> $ mkdir headers
> $ touch headers/test.h
> $ gcc -c test.c -I./headers -include test.h
> $ clang -c test.c -I./headers -include test.h
> In file included from <built-in>:103:
> <command line>:1:10: fatal error: '/Users/rp/test.h' file not found
> #include "/Users/rp/test.h"
>          ^
>
> $ clang --version
> clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/trunk 69762)
> Target: i386-apple-darwin9
>
> Robert P.
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090422/c3ed9e64/attachment.html>


More information about the cfe-dev mailing list