-
Notifications
You must be signed in to change notification settings - Fork 6
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
Use of legacy C integer types #27
Comments
There was a similar annoying legacy issue with the usage of "int" for a length in Python 2. A very slow transition to Py_ssize_t took years to be completed. It was about PyArg_Parse and Py_Build API families. The migration was implemented by defining an opt-in macro in ported C extensions. |
Regarding |
In theory, I don't think we can make all values a fixed size. The return type of a length function will depend on the size of the address space. |
Issue for proposed guidelines: capi-workgroup/api-evolution#10 |
I close this issue, let's continue the discussion there. |
We use the C type
long
a lot in the C API, which is problem becauselong
varies in size across platforms in a way that is hard to deal with. Along
might be 32bit or 64bit on a 64bit platform, which makes for lots of#ifdef
s and conditional logic that wouldn't be needed if we used C99stdint
integer types.Our code is also full of
int
where we meanint32_t
.int
is almost always 32 bit, but it is not guaranteed.The text was updated successfully, but these errors were encountered: