Skip to content

COMMON_FIELDS macro in funcobject.h leaks to user code #118207

@itamaro

Description

@itamaro

Bug report

Bug description:

the COMMON_FIELDS macro is defined here, and can end up being included in user code (via Python.h).

"COMMON_FIELDS" is not a unique enough identifier, and can conflict with other use of the same name in user C/C++ code (has happened to us at Meta).

this macro is used only twice within the same header as it is defined, so it should be straight forward to undef it after it is used to prevent it from leaking (PR coming up).

CPython versions tested on:

3.10, 3.12, 3.13

Operating systems tested on:

Linux, macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions