Re: [PATCH] Various pages: SYNOPSIS: Use VLA syntax in function parameters

Alejandro Colomar
2022-09-05T14:32:19Z

[-- Attachment #1.1: Type: text/plain, Size: 730 bytes --]

Hi Martin,

On 9/3/22 22:02, Alejandro Colomar wrote:
>>>> We thought about using this syntax
>>>>
>>>> int foo(char buf[.n], int n);

BTW, it would be useful if this syntax was accepted for void * too,
especially since GNU C allows pointer arithmetic on void *.

void *memmove(void dest[.n], const void src[.n], size_t n);

I understand that a void array doesn't make sense, so defining a VLA of
type void is an error elsewhere, but since array parameters are not
really arrays, and instead pointers, this could be reasonable.

The same that these "arrays" can have zero sizes, or even negative ones
in some weird cases.

Cheers,

Alex

--
Alejandro Colomar