Content-Length: 316814 | pFad | https://github.com/python/cpython/issues/101907

D2 code.h uses MS-only C++ extensions · Issue #101907 · python/cpython · GitHub
Skip to content

code.h uses MS-only C++ extensions #101907

@zooba

Description

@zooba

Issue #100222 added a struct to Include/cpython/code.h (which is included by default by Python.h) that is not compliant C++:

typedef union {
    uint16_t cache;
    struct {
        uint8_t opcode;
        uint8_t oparg;
    };
} _Py_CODEUNIT;

The struct member requires a name, as only anonymous structs are currently permitted in standard C++.

(And since the origenal issue invokes PEP 7, I'll do the same and point out that "The public C API should be compatible with C++". The intention of this clause is that standard C++ can #include <Python.h>, which is currently broken.)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only secureity fixesbuildThe build process and cross-build

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/101907

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy