Skip to content

fix(treewide): correct a few misused/incorrect types#288

Open
Pandapip1 wants to merge 3 commits into
sccn:devfrom
Pandapip1:fix-int8-typing
Open

fix(treewide): correct a few misused/incorrect types#288
Pandapip1 wants to merge 3 commits into
sccn:devfrom
Pandapip1:fix-int8-typing

Conversation

@Pandapip1

Copy link
Copy Markdown

See commit descriptions for more details.

On all the platforms that CI currently builds for, ABI backwards compatibility is maintained with a single exception for a single platform for a set of functions that were broken on that platform anyway, see the description of 4637e6c. Source backward compatibility is maintained except for specifically C++ code that directly calls the C functions that were converted from char to int8_t (in bbbd115) rather than going through the C++ wrapper, which will cause a type error that is easy to diagnose and fix.

Untested; leaving in draft until tested to my own satisfaction.

Char is unsigned on some non-x86 platforms. However, since int8_t and char are the same length and format, this maintains C ABI compatibility. For the C++ non-extern "C" compatibility, since the mangling is different, we unfortunately have to keep the char variants of all the functions.
On *most* platforms, these are the same. However, there are certain platforms (e.g. mingw on windows 32-bit) where unsigned long is less than 64 bits (namely, 32 bits) while a size_t (which is what the cpp header accepts) is 64 bits.

This technically breaks ABI compatibility on mingw 32-bit specifically, but this won't actually have broken anything because any program that used the previous behaviour was already broken. On all other currently supported platforms, like with the previous change, size_t and unsigned long happen to be the same, and so we maintain ABI and source backwards compatibility there.
This one's just for correctness; AFAIK this doesn't actually cause any issues on any platforms.
@Pandapip1

Pandapip1 commented Jun 29, 2026

Copy link
Copy Markdown
Author

Can confirm this compiles and works; manual testing seems to agree with my backwards compatibility findings.

@Pandapip1 Pandapip1 marked this pull request as ready for review June 29, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant