3 ms·
The specification allows implementations to have limits on maximum call stack depth and all sorts of other things. It's absolutely semantically meaningful in C
by mort96 2mo ago
The specification allows implementations to have limits on maximum call stack depth and all sorts of other things. It's absolutely semantically meaningful in C to allocate a new stack frame.
- layer8 2mo agoThe details of how a stack is managed isn't normally part of programming language semantics.
- mort96 2mo agoNo, but "this action consumes a potentially exhaustible resource and could therefore fail" is normally part of programming language semantics
- layer8 2mo agoAny function call can fail due to resource exhaustion (unless the language specification includes a mechanism to guarantee success, which hardly any language does). The specifications of the semantics of a programming language are usually silent on the behavior of programs under such resource failures; it’s outside of what is specified.
- mort96 2mo agoYes, any function call can fail due to resource (i.e stack space) exhaustion. Other things, like integer addition or a while loop, can not. This is semantically relevant.