C++ Logo

std-proposals

Advanced search

Re: [std-proposals] C++ never had a compiler without a stack

From: Lénárd Szolnoki <cpp_at_[hidden]>
Date: Wed, 16 Aug 2023 17:34:27 +0100
On 16 August 2023 15:20:40 BST, Thiago Macieira via Std-Proposals <std-proposals_at_[hidden]> wrote:
>On Wednesday, 16 August 2023 04:42:09 PDT David Brown via Std-Proposals wrote:
>> Some people argue that alloca() and VLAs are unsafe because there is no
>> way to get run-time feedback if the sizes are too big and you overflow
>> the stack - it's straight to UB.
>
>The fact that the implementations don't give feedback does not mean that they
>couldn't give feedback if they needed to. The bounds of the stack can be saved
>by the runtime in a thread-local variable.
>

Rust makes stack overflow a guaranteed termination on its "Tier 1" target platforms.

Cheers,
Lénárd

Received on 2023-08-16 16:34:35