Skip to content
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

Use %zd printf format in the C code of Python #93202

Closed
vstinner opened this issue May 25, 2022 · 1 comment
Closed

Use %zd printf format in the C code of Python #93202

vstinner opened this issue May 25, 2022 · 1 comment
Labels
type-bug An unexpected behavior, bug, or error

Comments

@vstinner
Copy link
Member

Python 3.12 now requires a C11 compiler. We don't have to check if the %zd printf format is supported: it's available since C99. Python 3.6 requires a C99 compiler to build.

The PY_FORMAT_SIZE_T macro was already updated to be always defined as "z": commit d765d81.

This issue is a follow-up of the previous issue #81962.

@vstinner vstinner added the type-bug An unexpected behavior, bug, or error label May 25, 2022
vstinner added a commit that referenced this issue May 25, 2022
Python now always use the ``%zu`` and ``%zd`` printf formats to
format a size_t or Py_ssize_t number. Building Python 3.12 requires a
C11 compiler, so these printf formats are now always supported.

* PyObject_Print() and _PyObject_Dump() now use the printf %zd format
  to display an object reference count.
* Update PY_FORMAT_SIZE_T comment.
* Remove outdated notes about the %zd format in PyBytes_FromFormat()
  and PyUnicode_FromFormat() documentations.
* configure no longer checks for the %zd format and no longer defines
  PY_FORMAT_SIZE_T macro in pyconfig.h.
* pymacconfig.h no longer undefines PY_FORMAT_SIZE_T: macOS 10.4 is
  no longer supported. Python 3.12 now requires macOS 10.6 (Snow
  Leopard) or newer.
@vstinner
Copy link
Member Author

Fixed by #93201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant