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

Joseph Myers
2022-11-29T16:55:45Z

On Tue, 29 Nov 2022, Michael Matz via Gcc wrote:

> like. But I'm generally doubtful of this whole feature within C itself.
> It serves a purpose in documentation, so in man-pages it seems fine enough
> (but then still could use a different puncuator to not be confusable with
> C syntax).

In man-pages you don't need to invent syntax at all. You can write

int f(char buf[n], int n);

and in the context of a man page it will be clear to readers what is
meant, though such a syntax would be problematic in actual C source files
because of issues with circular dependencies between parameters and with n
already being declared in an outer scope.

--
Joseph S. Myers
joseph@codesourcery.com