Skip to content

New _Py_STDC_VERSION macro not available in pyport.h #160719

Open

Description

@fuhsnn

Bug report

The new _Py_STDC_VERSION macro introduced in 47163e5, 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:

cpython/Include/Python.h

Lines 67 to 71 in 210e7ab

// Include Python header files
#include "pyport.h"
#include "exports.h"
#include "pymacro.h"
#include "pymath.h"

So for example this branch will never be true because _Py_STDC_VERSION is undefined here:

cpython/Include/pyport.h

Lines 494 to 495 in f4043ab

# elif _Py_STDC_VERSION >= 201112L && !defined(__STDC_NO_THREADS__)
# define _Py_thread_local _Thread_local

CPython versions tested on:

3.15, CPython main branch

Operating systems tested on:

Linux

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions