[LLVMbugs] [Bug 4897] New: [2.6] clang doesn' t search CWD for include files when reading from stdin
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Fri Sep 4 23:11:20 PDT 2009
http://llvm.org/bugs/show_bug.cgi?id=4897
Summary: [2.6] clang doesn't search CWD for include files when
reading from stdin
Product: new-bugs
Version: 2.6
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: edwintorok at gmail.com
CC: llvmbugs at cs.uiuc.edu
Perl's t/comp/cpp fails, when using clang:
1..3
ok 1
ok 2
<stdin>:2:10: fatal error: 'Comp_cpp.inc' file not found
#include "Comp_cpp.inc"
^
1 diagnostic generated.
not ok 3
This is because the following command gives an error:
$ clang -E -C -I/usr/local/lib/perl5/5.10.0 - <Comp_cpp.tmp
<stdin>:2:10: fatal error: 'Comp_cpp.inc' file not found
#include "Comp_cpp.inc"
^
# 1 "<stdin>"
# 1 "<stdin>" 1
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 105 "<built-in>" 3
# 105 "<command line>" 1
# 1 "<stdin>" 2
$ok = "not ok 3\n";
print $ok;
1 diagnostic generated.
Running this with llvm-gcc or gcc works:
clang -E -C -I/usr/local/lib/perl5/5.10.0 - <Comp_cpp.tmp
<stdin>:2:10: fatal error: 'Comp_cpp.inc' file not found
#include "Comp_cpp.inc"
^
# 1 "<stdin>"
# 1 "<stdin>" 1
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 105 "<built-in>" 3
# 105 "<command line>" 1
# 1 "<stdin>" 2
$ok = "not ok 3\n";
print $ok;
1 diagnostic generated.
Comp_cpp.inc is in the current directory, and contains this:
#define OK "ok 3\n"
This is not due to -I and -C, even clang -E - <Comp_cpp.tmp fails to find the
.inc, however using -x -c Comp_cpp.tmp instead of - <Comp_cpp.tmp works.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list