[llvm-bugs] [Bug 34931] New: `#pragma once` doesn't work in a ciopfs mount if the header is included through two different cases

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 12 14:24:38 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34931

            Bug ID: 34931
           Summary: `#pragma once` doesn't work in a ciopfs mount if the
                    header is included through two different cases
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvm-bugs at lists.llvm.org

$ mkdir icase icase.cp
$ ciopfs icase.cp/ icase
$ cat icase/File.h 
#pragma once
struct S {};
$ cat test.cc
#include "file.h"
#include "File.h"
$ third_party/llvm-build/Release+Asserts/bin/clang -c test.cc -I icase
In file included from test.cc:2:
icase/File.h:3:8: error: redefinition of 'S'
struct S {};
       ^
icase/file.h:3:8: note: previous definition is here
struct S {};
       ^
1 error generated.


This shouldn't error out.


It works fine with a real FAT mount:

$ fallocate -l 10m icase.disk
$ mkfs.vfat icase.disk 
mkfs.fat 3.0.26 (2014-03-07)
$ mkdir icase.fat
$ sudo mount icase.disk icase.fat -t vfat -o loop,owner,group,umask=000
[sudo] password for thakis: 
$ cp icase/File.h icase.fat/
$ cat icase.fat/File.h 
#pragma once
struct S {};
$ third_party/llvm-build/Release+Asserts/bin/clang -c test.cc -I icase.fat
test.cc:1:10: warning: non-portable path to file '"File.h"'; specified path
differs in case from file name on disk [-Wnonportable-include-path]
#include "file.h"
         ^~~~~~~~
         "File.h"
1 warning generated.



It'd be cool if this worked with ciopfs too, since that doesn't need root to
use.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171012/7c94fd61/attachment.html>


More information about the llvm-bugs mailing list