Open
Description
One common source of portability issues is making assumptions about whether c_char
is i8
or u8
. Code written for one platform may fail to build on another due because of this.
I think we could detect this fairly easily: we could add an attribute that means "yes, this is a type alias, but treat it as a slightly distinct type, and lint when matching it against the aliased type if not going through this type alias to do so".
This would help people avoid gratuitous portability issues.
Metadata
Metadata
Assignees
Labels
Area: Foreign function interface (FFI)Area: Lints (warnings about flaws in source code) such as unused_mut.Category: An issue proposing an enhancement or a PR with one.Call for participation: Hard difficulty. Experience needed to fix: A lot.This issue needs exploration and design to see how and if we can fix/implement itTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateTarget: PowerPC processorsTarget: SystemZ processors (s390x)Operating system: AndroidRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the language team, which will review and decide on the PR/issue.