-
-
Notifications
You must be signed in to change notification settings - Fork 10
CppCodeWriter should write out paths using / for the directory separator instead of \ #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Reopening this because it came up again for Linux support #108 since Right now the logic added by this change is Windows-only. This is technically correct, but might be problematic. A backslash is technically a valid character for file/folder names on Linux, but they are definitely not common. This creates an awkward situation where a poorly-written generator might work fine on Windows but not on Linux if the generator author is building include paths using string concatenation instead of We essentially have three options:
|
I created a test to see how C++ compilers react to this "legitimate" situation on Linux to see if maybe they print a really obvious message about how you're trying to compile code written by an ignorant Windows dev. First: Lol, VSCode barfs trying to open a To test I created this file: #include "Dumb\Name.h"
int Test(MyStruct s)
{
return s.x;
}
int main()
{
MyStruct s;
return Test(s);
} in one case I created the file in the same directory struct MyStruct
{
int x;
}; For the sake of clarity, here's the directory tree:
For the legitimate edge case, neither GCC nor Clang complained. For the bad Windows dev case, both obviously complain but do not mention anything specific about the file existing if the path separator wasn't dumb (which isn't surprising, but I had hope):
|
I think the original behavior is the most correct. The intent behind this change was to make it so We can revisit this if it ever becomes an issue. However I suspect the target audience of Biohazrd is generally going to know that |
No description provided.
The text was updated successfully, but these errors were encountered: