C++ Logo

std-proposals

Advanced search

Re: Arrays (VLAs) as function parameters (as in C99)

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 14 Nov 2021 14:13:49 -0800
On Sunday, 14 November 2021 12:26:19 PST JeanHeyd Meneide wrote:
> This is changing, including in the C Standard itself. The new C
> Standard is going to ship signatures using the static syntax since it
> aids with compile-time QoI errors regarding too-small arrays.
> Sanitizers are picking up on pointer-to-VLA (not VLA) definitions now,
> and warning on size arrays. We might also be looking into allowing the
> void[ static n ] syntax so we can start appropriately decorating
> functions like memcpy, memset, and similar.

That's interesting... but how would it work if the size parameter is after the
pointer variables?

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

Received on 2021-11-14 16:13:55