mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-40943: Replace PY_FORMAT_SIZE_T with "z" (GH-20781)
The PEP 353, written in 2005, introduced PY_FORMAT_SIZE_T. Python no longer supports macOS 10.4 and Visual Studio 2010, but requires more recent macOS and Visual Studio versions. In 2020 with Python 3.10, it is now safe to use directly "%zu" to format size_t and "%zi" to format Py_ssize_t.
This commit is contained in:
parent
24b8bad6d3
commit
d36cf5f1d2
11 changed files with 89 additions and 101 deletions
|
@ -131,7 +131,9 @@ typedef int Py_ssize_clean_t;
|
|||
/* Smallest negative value of type Py_ssize_t. */
|
||||
#define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1)
|
||||
|
||||
/* PY_FORMAT_SIZE_T is a platform-specific modifier for use in a printf
|
||||
/* Macro kept for backward compatibility: use "z" in new code.
|
||||
*
|
||||
* PY_FORMAT_SIZE_T is a platform-specific modifier for use in a printf
|
||||
* format to convert an argument with the width of a size_t or Py_ssize_t.
|
||||
* C99 introduced "z" for this purpose, but old MSVCs had not supported it.
|
||||
* Since MSVC supports "z" since (at least) 2015, we can just use "z"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue