New `_Py_STDC_VERSION` macro not available in pyport.h

Offen
#160,719 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
c
Bereich
build-system

Rechercherichtung

Read Include/pyport.h around lines 494–495 and Include/Python.h around lines 67–71, then trace where Include/pymacro.h is included. Check the reported include order and confirm whether _Py_STDC_VERSION is defined when pyport.h uses it; done means the macro is available at that point and the affected branch can work as intended.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

topic-C-API type-bug
Bug report

The new _Py_STDC_VERSION macro introduced in 47163e53753ea681d2b4bd2683f4ca4833838b89, is located in Include/pymacro.h‎ and used in Include/pyport.h, but it seems pymacro.h‎ is only ever included in Python.h, and after pyport.h:

https://github.com/python/cpython/blob/210e7ab2a581af5d106c5b648db0a6f9535004aa/Include/Python.h#L67-L71

So for example this branch will never be true because _Py_STDC_VERSION is undefined here:
https://github.com/python/cpython/blob/f4043ab1be0205d834a8b9aa72e289be12637344/Include/pyport.h#L494-L495

CPython versions tested on:

3.15, CPython main branch

Operating systems tested on:

Linux

Linked PRs
  • gh-160733
Vorherrschende Sprache
Python
Sterne
77.8k
Forks
37.7k
Ø Merge
15 Std. 24 Min.
Gemergte PRs (30 T.)
728

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus python/cpython

Alle Issues in python/cpython

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.