Better C integer definitions#6645
Conversation
|
What makes these definitions better? Do we need to support both C99 and pre-C99? What is the minimum needed for CPython itself, or other libraries such as NumPy? |
|
The oldest version of GCC I could find that we are using is 4.8.5 - https://github.com/python-pillow/docker-images/actions/runs/4813262439/jobs/8569570838#step:6:99 https://gcc.gnu.org/onlinedocs/gcc-4.8.5/cpp.pdf
|
PEP 7 says:
|
https://numpy.org/doc/stable/user/building.html says:
|
|
We previously discussed the minimum C version here: #6516 If we could guarantee that |
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
|
Thanks. And CentOS 7 is EOL on 30 Jun 2024. We could consider requiring a newer C for Pillow 10.4, due out the next day on 1 Jul 2024, but I'd be more comfortable rolling it into the next quarterly release seeing as it's a major bump (11.0, 15 Oct 2024, supporting Python 3.9+). And we may want to keep support for older C versions longer, but let's re-evaluate in a year or so. |
|
@nulano How does this look from the Windows perspective? |
|
I don't see any Windows changes in this PR.
I think this also applies to Windows. I'm not sure if it is guaranteed to exist on Windows, but if it might not be present on other platforms, I see no reason to worry about it yet. |
INT64definition where it was checking the size oflong longbut then defining it aslong.INT64wasn't defined.#defineinstead oftypedef.stdint.hif possible.INT8definition to the top, so that they're all in order by size.INT16definition failure to an error instead of silently using the wrong value. There was a comment saying things mostly worked anyways, but I'm skeptical of that, and also we were already failing ifINT32couldn't be defined, so I doubt it would have gotten past that point anyways.