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

Alejandro Colomar alx.manpages@gmail.com
Mon Sep 5 14:31:56 GMT 2022


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
<http://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20220905/007a90c2/attachment-0001.sig>


More information about the Gcc mailing list