fix(treewide): correct a few misused/incorrect types#288
Open
Pandapip1 wants to merge 3 commits into
Open
Conversation
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.
b798d04 to
f517b84
Compare
Author
|
Can confirm this compiles and works; manual testing seems to agree with my backwards compatibility findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
chartoint8_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.