[llvm-bugs] [Bug 46024] New: -fixit changes file casing for 'nonportable-include-path' warnings

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 21 13:45:50 PDT 2020


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

            Bug ID: 46024
           Summary: -fixit changes file casing for
                    'nonportable-include-path' warnings
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: duncan.horn at utexas.edu
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

For example, if I have the following three files:

main.cpp:
```
#include "a.h"
int main() {}
```

A.h:
```
#pragma once
#include "b.h"
```

B.h:
```
#pragma once
#include "a.h"
```

In the above, both A.h and B.h are capitalized, however all three files include
each other using lowercase characters. Building this correctly gives
'nonportable-include-path' warnings suggesting that the includes be
capitalized. If I pass '-Xclang -fixit' as a compilation argument, these
include statements correctly get updated to be uppercase, however when it goes
to save the new contents of A.h and B.h, it lowercases both filenames. I.e. to
a.h and b.h respectively. Now if I build, I get the 'nonportable-include-path'
warning again, but this time suggesting that the include statements be made
lowercase since that's now what the files are named. If I again run with
'-Xclang -fixit', the includes get "fixed" to be lowercase, but the files are
now saved with capitalized file names. Rinse and repeat.

Seems as though spelling of the include directive is influencing some cached
file name that persists all the way up to saving the file on disk.

-- 
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/20200521/d8eaaa4b/attachment.html>


More information about the llvm-bugs mailing list