Uh oh!
There was an error while loading. Please reload this page.
gh-91731: Replace Py_BUILD_ASSERT() with static_assert() - #91730
Conversation
vstinner
commented
Apr 20, 2022
Failure on macOS: Oh, Python is still built with |
vstinner
commented
Apr 20, 2022
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.
bedevere-bot
commented
Apr 20, 2022
vstinner
commented
Apr 20, 2022
I scheduled buildbot jobs to check how it goes on other platforms/C compilers. |
vstinner
commented
Apr 20, 2022
This is unrelated to my PR. The leak is known in the main branch. |
vstinner
commented
Apr 20, 2022
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. |
vstinner
commented
Apr 20, 2022
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.