-
Notifications
You must be signed in to change notification settings - Fork 1
Soft-deprecating outdated helper macros #99
Copy link
Copy link
Closed
Description
In a follow-up to #86,
I propose formally soft-deprecating helper macros which have equivalents in C99.
We won't be updating them, and we won't be using them as precedent for adding similar macros.
I propose undefining them internally (with Py_BUILD_CORE), and switch away if we still use them.
Py_LL&Py_ULL: UseLL/ULLsuffixes.Py_MEMCPY(already soft-deprecated)Py_VA_COPY: Useva_copydirectly.PY_LONG_LONG,PY_LLONG_MIN,PY_LLONG_MAX,PY_ULLONG_MAX,PY_INT32_T,PY_UINT32_T,PY_INT64_T,PY_UINT64_T,PY_SIZE_MAX: Use C99 types/limitsPy_UNICODE_SIZE: Usesizeof(wchar_t)directlyPY_FORMAT_SIZE_T: Use"z"directlyPy_BUILD_ASSERT: Use_Static_assert(C11) orstatic_assert(C++ & C23) insteadPy_ALIGNED: Use_Alignas(C11) oralignas(C++ & C23) instead.- This one should be undefined internally (with
Py_BUILD_CORE); we should switch to the more robust_Py_ALIGNED_DEFinstead.
- This one should be undefined internally (with
Additionally I propose soft-deprecating the following:
Py_BUILD_ASSERT_EXPR: In virtually all cases,Py_BUILD_ASSERTis enough.
In CPython it's only used to definePy_BUILD_ASSERT(for old compilers) andPy_ARRAY_LENGTH(which can do without it).PY_DWORD_MAX: Not a good precedent for public API. CPython internals should continue using it.
For Py_UNICODE_WIDE, which is scheduled for removal, I propose soft-deprecating instead. There's been no visible warning outside docs, and removing an #ifdef macro is indistinguishable from making it “false”.
I consider this clerical clean-up so I haven't started a wider discussion. Let me know if you think any of this is controversial.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels