[SR-13176] CChar/CWideChar has fixed signs #55618
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Additional Detail from JIRA
md5: 0882752479bfc97666a192c39dc7308e
Issue Description:
In standard library, {{CChar}} and {{CWideChar}} are mapped to fixed Swift types. But their corresponding C type {{char}} and {{wchar_t}} have varied signs on different platforms. As remarked here:
> Android and Linux IIRC are unsigned char for char (on ARM/AArch64) and Windows and macOS are signed char (on ARM/ARM64). On x86/x86_64, all of them should be signed char. On PPC/PPC64 there is a bug I believe that only Darwin will be treated as signed char when it should mirror the ARM/AArch64 case.
Swift should find a solution where the imported API and stdlib types have matched sign. Or somehow make this a non-issue (by introducing a signless byte type, for example).
The text was updated successfully, but these errors were encountered: