Skip to content

GH-125174: Don't use UINT32_MAX in header file #127863

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

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Dec 12, 2024

It breaks a buildbot. Maybe UINT32_MAX isn't defined in their C++ header files.

@markshannon markshannon changed the title Don't use UINT32_MAX in header file GH-125174: Don't use UINT32_MAX in header file Dec 12, 2024
@markshannon
Copy link
Member Author

!buildbot "AMD64 FreeBSD 3.x"

@bedevere-bot
Copy link

The regex '"AMD64 FreeBSD 3.x"' did not match any buildbot builder. Is the requested builder in the list of stable builders?

@markshannon
Copy link
Member Author

!buildbot "AMD64.FreeBSD.3.x"

@bedevere-bot
Copy link

The regex '"AMD64.FreeBSD.3.x"' did not match any buildbot builder. Is the requested builder in the list of stable builders?

@markshannon
Copy link
Member Author

!buildbot AMD64.FreeBSD

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @markshannon for commit 957cf8a 🤖

The command will test the builders whose names match following regular expression: AMD64.FreeBSD

The builders matched are:

  • AMD64 FreeBSD PR
  • AMD64 FreeBSD Refleaks PR
  • AMD64 FreeBSD14 PR
  • AMD64 FreeBSD15 PR

@colesbury
Copy link
Contributor

In case you were wondering why it's missing, like I was:

The C99 standard suggests that C++ implementations should not define the above limit, constant, or format macros unless the macros __STDC_LIMIT_MACROS, __STDC_CONSTANT_MACROS or __STDC_FORMAT_MACROS (respectively) are defined before including the relevant C header (stdint.h or inttypes.h). This recommendation was not adopted by any C++ standard and was removed in C11. However, some implementations (such as glibc 2.17) try to apply this rule, and it may be necessary to define the __STDC macros; C++ compilers may try to work around this by automatically defining them in some circumstances

https://en.cppreference.com/w/cpp/types/integer

@markshannon markshannon requested a review from encukou December 12, 2024 15:56
@encukou encukou merged commit 9b4bbf4 into python:main Dec 13, 2024
47 checks passed
@encukou
Copy link
Member

encukou commented Dec 13, 2024

Thank you for the fix!

srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
@markshannon markshannon deleted the no-uint32 branch January 10, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants