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

Ignore signed-ness in encoding #567

Merged
merged 1 commit into from
May 20, 2024
Merged

Ignore signed-ness in encoding #567

merged 1 commit into from
May 20, 2024

Conversation

madsmtm
Copy link
Owner

@madsmtm madsmtm commented Jan 21, 2024

Fixes #566.

Unsure if this is the correct path forwards.

Do signed-ness ever matter ABI-wise? The Rust docs says on ABI of i32 vs u32:

on some targets, the calling conventions for these types differ in terms of what they guarantee for the remaining bits in the register that are not used by the value.

But is that relevant for any platforms we target? And does it matter for types like usize/isize, which won't have remaining bits left in any registers?

@madsmtm madsmtm added help wanted Extra attention is needed A-objc2 Affects the `objc2`, `objc-sys` and/or `objc2-encode` crates labels Jan 21, 2024
@madsmtm
Copy link
Owner Author

madsmtm commented Jan 21, 2024

Swift doesn't make a distinction between NSInteger and NSUInteger when importing methods, though they do so when importing other signed/unsigned C types, so maybe we should handle pointer-sized types specially here?

@madsmtm madsmtm force-pushed the ignore-signed branch 2 times, most recently from 5989f04 to c94ed78 Compare May 19, 2024 23:54
@madsmtm
Copy link
Owner Author

madsmtm commented May 20, 2024

I've decided to go with a feature flag relax-sign-encoding for now. In the future, we should probably restrict the encoding checks for extern_methods! in CI, and not on the user's machine

@madsmtm madsmtm merged commit 6b30466 into master May 20, 2024
19 checks passed
@madsmtm madsmtm deleted the ignore-signed branch May 20, 2024 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-objc2 Affects the `objc2`, `objc-sys` and/or `objc2-encode` crates help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Swift array count: expected return to have type code 'q', but found 'Q'
1 participant