C++ Logo

std-proposals

Advanced search

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

From: JeanHeyd Meneide <phdofthehouse_at_[hidden]>
Date: Sun, 14 Nov 2021 15:26:19 -0500
> Shows you how little this gets used. And it's not just the fact that I'm a C++
> developer primarily -- if I ask my colleagues who code mostly in C, I bet you
> they won't know.

     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.

     It would be nice to not have to macro-define these things away.

Sincerely,
JeanHeyd Meneide

Received on 2021-11-14 14:26:33