Issue 207885
Summary [Support] Reconsider sys::path::native() semantics for POSIX paths
Labels new issue
Assignees
Reporter zeyi2
    `llvm::sys::path::native()` currently rewrites backslashes to forward slashes on POSIX platforms.

That behavior is documented, but it is easy to misuse for real POSIX filesystem paths because `\` is a valid filename character on POSIX, not a path separator. For example, a POSIX path like:

```text
a\b.cc
```

names a file whose filename contains a literal backslash. After `sys::path::native()`, it becomes:

```text
a/b.cc
```

which names a different path.

Should we clarify, discourage, or eventually deprecate `sys::path::native()` for real filesystem paths on POSIX? 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to