-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
gh-91731: Replace Py_BUILD_ASSERT() with static_assert() #91730
Conversation
Failure on macOS:
Oh, Python is still built with |
I will first merge #91733 which replaces |
Python 3.11 now uses C11 standard which adds static_assert() to <assert.h>. * In pytime.c, replace Py_BUILD_ASSERT() with preprocessor checks on SIZEOF_TIME_T with #error. * On macOS, py_mach_timebase_info() now accepts timebase members with the same size than _PyTime_t. * py_get_monotonic_clock() now saturates GetTickCount64() to _PyTime_MAX: GetTickCount64() is unsigned, whereas _PyTime_t is signed.
I scheduled buildbot jobs to check how it goes on other platforms/C compilers. |
This is unrelated to my PR. The leak is known in the main branch. |
Python was built successfully on various versions of Windows, macOS, Ubuntu and FreeBSD on various architectures. I confirm that it confirms that C11 is now well supported. If a platform doesn't support C11, it can reimplement static_assert() with Py_BUILD_ASSERT() or get a C11 compiler :-) I merge my PR. |
See #91757 |
Python 3.11 now uses C11 standard which adds static_assert()
to <assert.h>.
SIZEOF_TIME_T with #error.
the same size than _PyTime_t.
_PyTime_MAX: GetTickCount64() is unsigned, whereas _PyTime_t is
signed.