[PATCH] Various pages: SYNOPSIS: Use VLA syntax in function parameters
Michael Matz
matz@suse.de
Tue Nov 29 14:58:11 GMT 2022
Hey,
On Tue, 29 Nov 2022, Alex Colomar via Gcc wrote:
> How about the compiler parsing the parameter list twice?
This _is_ unbounded look-ahead. You could avoid this by using "." for
your new syntax. Use something unambiguous that can't be confused with
other syntactic elements, e.g. with a different punctuator like '@' or the
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).
But within C it still can only serve a documentation purpose as no
checking could be performed without also changes in how e.g. arrays are
represented (they always would need to come with a size). It seems
doubtful to introduce completely new and ambiguous syntax with all the
problems Joseph lists just in order to be able to write documentation when
there's a perfectly fine method to do so: comments.
Ciao,
Michael.
More information about the Gcc
mailing list