Skip to content
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

[SR-13176] CChar/CWideChar has fixed signs #55618

Open
dduan opened this issue Jul 8, 2020 · 0 comments
Open

[SR-13176] CChar/CWideChar has fixed signs #55618

dduan opened this issue Jul 8, 2020 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@dduan
Copy link
Collaborator

dduan commented Jul 8, 2020

Previous ID SR-13176
Radar None
Original Reporter @dduan
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee None
Priority Medium

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).

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

1 participant