Repository navigation
Fail to build with tail cail optimization on Windows #141937
Copy link
Copy link
Closed as duplicate
Labels
OS-windowsbuildThe build process and cross-buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Building CPython with tail call optimization makes this error related to tail call optimization:
...
C:\cpython\Python\opcode_targets.h(282,38): error C2085: '_TAIL_CALL_BINARY_OP_SUBSCR_STR_INT': not in formal parameter list [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(283,1): error C2061: syntax error: identifier '__attribute__' [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(284,1): error C2143: syntax error: missing ')' before '(' [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(284,1): error C2059: syntax error: ')' [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(284,21): error C2143: syntax error: missing ')' before 'type' [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(284,1): error C2091: function returns function [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(284,38): error C2085: '_TAIL_CALL_BINARY_OP_SUBTRACT_FLOAT': not in formal parameter list [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(285,1): error C2061: syntax error: identifier '__attribute__' [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(286,1): error C2143: syntax error: missing ')' before '(' [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(286,1): error C2059: syntax error: ')' [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(286,21): error C2143: syntax error: missing ')' before 'type' [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(286,1): error C2091: function returns function [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(286,38): error C2085: '_TAIL_CALL_BINARY_SLICE': not in formal parameter list [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(287,1): error C2061: syntax error: identifier '__attribute__' [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(288,1): error C2143: syntax error: missing ')' before '(' [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(288,1): error C2059: syntax error: ')' [C:\cpython\PCbuild\pythoncore.vcxproj]
C:\cpython\Python\opcode_targets.h(288,1): error C1003: error count exceeds 100; stopping compilation [C:\cpython\PCbuild\pythoncore.vcxproj]
While building without it works!
CPython versions tested on:
3.14
Operating systems tested on:
Windows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
OS-windowsbuildThe build process and cross-buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
sergey-miryanov commentedon Nov 25, 2025
How do you build it?
On 3.14 it fails with message:
Tail calling not supported for MSVC.On main it fails with message:
You need at least VS 2026 / PlatformToolset v145 for tail calling.chris-eibl commentedon Nov 25, 2025
Tail calling for MSVC is not supported in 3.14 and fails with the given error above on latest 3.14.
#139922 will implement it for 3.15.
@winapiadmin I think we can close this?
winapiadmin commentedon Nov 25, 2025
probably make it part of 3.14.1 (or 3.15)