C++ Logo

std-proposals

Advanced search

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

From: DBJ <dbj_at_[hidden]>
Date: Sun, 14 Nov 2021 21:16:00 +0100
"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 puzzle's me. Provided, I understood it right.

Please see here, for a comprehensive post on this subject:
https://gustedt.wordpress.com/2011/01/13/vla-as-function-arguments/

Kind regards


On Sun, 14 Nov 2021 at 20:48, Alejandro Colomar (man-pages) via
Std-Proposals <std-proposals_at_[hidden]> wrote:

>
>
> On 11/14/21 20:41, Alejandro Colomar (man-pages) wrote:
> > Yup, it's a weird and rarely-used syntax
> > (IMHO, because it's not very well designed,
> > and also because it's ignored by all compilers).
> > Let me clarify it:
> >
> > '[static n]' means that both:
> >
> > - The pointer cannot be NULL.
> > - the array has at least 'n' elements.
> >
> > '[n]' means:
> >
> > - nothing at all. 'n' is ignored.
> >
> > '[restrict n]' means:
> >
> > - 'n' is ignored.
> > - the storage may not overlap any other 'restrict' pointers or arrays.
> >
> > '[static restrict n]' means:
> >
> > - The pointer cannot be NULL.
> > - the array has at least 'n' elements.
> AND
> - the storage may not overlap any other 'restrict' pointers or arrays.
>
> I missed it.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2021-11-14 14:16:19