Skip to content

We should fail to compile if _Py_TAIL_CALL_INTERP is set but preserve_none and musttail do not exist. #140513

@Fidget-Spinner

Description

@Fidget-Spinner

Bug report

Bug description:

The code should look something like this:

#if _Py_TAIL_CALL_INTERP && (defined(__clang__) || defined(__GNUC__))
#    if !_Py__has_attribute(preserve_none) || !!_Py__has_attribute(musttail)
#        error "This compiler does not have support for efficient tail calling."
#    endif
#endif

CPython versions tested on:

CPython main branch, 3.15, 3.14

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixes3.15new features, bugs and security fixesbuildThe build process and cross-buildeasyinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions