New `_Py_STDC_VERSION` macro not available in pyport.h

Ouverte
#160,719 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
c
Domaine
build-system

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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
Langage dominant
Python
Étoiles
77.8k
Forks
37.7k
Merge moyen
15 h 24 min
PR mergées (30 j)
728

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de python/cpython

Toutes les issues de python/cpython

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.