-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
-fno-short-wchar: Inconsistent wchar_t Definition with L-Prefix Strings #461
Comments
I just realized that this is not actually the MinGW repository, but simply a repository for building the LLVM-MinGW-Compiler combination thingy. However, this still is a Clang and UCRT incompatiblity, so I am not sure whether this should actually be fixed, or whether it is acceptable that the feature is broken. All this is also caused by Microsoft being retarded and opting for UTF-16 instead of something decent, like UTF-8 or UTF-32 and hardcoding it retardedly into the UCRT. Maybe this could be patched, but I am sure that all the wchar functions would also be unfunctional and would need to be patched. Thus one should simply pray that one day the C23 UTF-8 functions will be properly implemented. I will reopen this issue, so maybe someone else will decide what to do with this finding. |
After playing around with this flag for a bit, I have also found a conflict between
|
I encountered an issue with the
-fno-short-wchar
flag while using the latest release of Clang MinGW on Windows. This flag should ensure that wchar_t is 4 bytes instead of 2 bytes (which forces UTF-16 encoding). On Linux, using Clang 19, this flag behaves as expected.However, in the newest release of Clang MinGW on Windows, the flag does not fully change the definition of wchar_t. While the flag causes the compiler to interpret L-prefixed strings as arrays of int (i.e., 4 bytes per character), the wchar_t type remains 2 bytes, as defined by unsigned short in the standard library. This inconsistency leads to a compiler warning and causes this flag to break existing code when working with L-prefixed strings.
Test Code
Compiler Output
Problematic Lines in the Standard Library (corecrt.h, line 95-100)
Summary
Excepted behaviour
The -fno-short-wchar flag should properly redefine wchar_t as 4 bytes across the entire system, including the standard library, to prevent mismatches.
Environment
The text was updated successfully, but these errors were encountered: