http://llvm.org/bugs/show_bug.cgi?id=11417

             Bug #: 11417
           Summary: clang silently ignores #include of non-seekable files
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Consider this ... insanity:

  #include "/proc/cpuinfo"

Okay. This file is not a device, but it is a non-seekable file.

nlewycky@ducttape:~$ ls -l /proc/cpuinfo
-r--r--r-- 1 root root 0 2011-11-21 14:59 /proc/cpuinfo
nlewycky@ducttape:~$ file /proc/cpuinfo
/proc/cpuinfo: empty

"file" in this case has the same bug, it uses the stat size *and trusts it*.
The Unix Way is to just open the file for reading if you're going to read it.
The size in stat is an advisory value only.

What happens is that the include produces no tokens at all. By contrast,
#include "/dev/stdin" produces an actual error "Illegal seek" and points to the
#include responsible. I'd like either the contents or a proper error.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to