Date: Wed, 16 Aug 2023 07:20:40 -0700
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.
> 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.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Software Architect - Intel DCAI Cloud Engineering
Received on 2023-08-16 14:20:44