Skip to content

Commit

Permalink
[3.11] gh-101100: Fix Py_DEBUG dangling Sphinx references (#115003) (#…
Browse files Browse the repository at this point in the history
…115141)

gh-101100: Fix Py_DEBUG dangling Sphinx references (#115003)

(cherry picked from commit d0322fd)
  • Loading branch information
smontanaro committed Feb 7, 2024
1 parent 3aa4418 commit e1e4cf7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Doc/c-api/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ complete listing.
worse performances (due to increased code size for example). The compiler is
usually smarter than the developer for the cost/benefit analysis.

If Python is :ref:`built in debug mode <debug-build>` (if the ``Py_DEBUG``
If Python is :ref:`built in debug mode <debug-build>` (if the :c:macro:`Py_DEBUG`
macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does nothing.

It must be specified before the function return type. Usage::
Expand Down Expand Up @@ -812,12 +812,14 @@ available that support tracing of reference counts, debugging the memory
allocator, or low-level profiling of the main interpreter loop. Only the most
frequently used builds will be described in the remainder of this section.

Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined produces
.. c:macro:: Py_DEBUG
Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined produces
what is generally meant by :ref:`a debug build of Python <debug-build>`.
:c:macro:`Py_DEBUG` is enabled in the Unix build by adding
:c:macro:`!Py_DEBUG` is enabled in the Unix build by adding
:option:`--with-pydebug` to the :file:`./configure` command.
It is also implied by the presence of the
not-Python-specific :c:macro:`_DEBUG` macro. When :c:macro:`Py_DEBUG` is enabled
not-Python-specific :c:macro:`!_DEBUG` macro. When :c:macro:`!Py_DEBUG` is enabled
in the Unix build, compiler optimization is disabled.

In addition to the reference count debugging described below, extra checks are
Expand All @@ -832,4 +834,3 @@ after every statement run by the interpreter.)

Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source distribution
for more detailed information.

0 comments on commit e1e4cf7

Please sign in to comment.