Both on Mac and Windows, it's common to have a 'Users' directory in the root of the filesystem, so one might specify a filename as '/Users/me/myfile.c'. clang-cl (as well as MSVC's cl.exe) will interpret that as invoking '/U' option, which is probably not what the user wanted. Add a warning about this.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/clang/Basic/DiagnosticDriverKinds.td | ||
---|---|---|
252 ↗ | (On Diff #85963) | For Windows, wouldn't it make more sense to suggest using valid paths (with backslashes instead of slashes)? What about all the other characters paths can begin with? Shouldn't we also warn that /code/myproject will also be interpreted as /c rather than \code\myproject? |
include/clang/Basic/DiagnosticDriverKinds.td | ||
---|---|---|
252 ↗ | (On Diff #85963) | I think it's better with a suggestion that works on both platforms. I also think users run into this more often on non-Windows. For /code/myproject we will not interpret it as the /c option since it has to be an exact match. /I, /D and others are problematic though. I think it's hard to fix this in general, but /U is the one people keep running into, so I think targeting that with a warning makes sense. |
Thanks for adding this, diagnosing what was going on here the first time around took a little bit of thinking.