Hi Joseph,
On Mon, Sep 15, 2025 at 09:34:13PM +0200, Alejandro Colomar wrote:
> Hi Joseph,
>
> On Mon, Sep 15, 2025 at 06:57:23PM +0000, Joseph Myers wrote:
> > On Sat, 13 Sep 2025, Alejandro Colomar wrote:
> >
> > > @@ -675,7 +675,7 @@ declaration}, and it serves the purpose of making the
> > > name @code{len}
> > > known when the declaration of @code{data} is parsed.
> > >
> > > You can write any number of such parameter forward declarations in the
> > > -parameter list. They can be separated by commas or semicolons, but the
> > > +parameter list. They can be separated by commas, and the
> >
> > The existence of an option to warn about a particular case of an extension
> > is certainly not a reason to remove documentation of that case!
>
> That documentation was never very clear. It doesn't for example say
> that eacch ';' constitutes a new list of parameter declarations (which
> is important, as you can't repeat a parameter in the same list).
>
> Being so badly documented, I considered it okay-ish to remove it as if
> it had never existed. Alternatively, I should write proper
> documentation for it, mentioning the differences of using ',' and ';'.
>
> I'll prepare a revised patch with that.
What do you think of this documentation?:
diff --git i/gcc/doc/extend.texi w/gcc/doc/extend.texi
index 2b92dee5cfd..571999eff4e 100644
--- i/gcc/doc/extend.texi
+++ w/gcc/doc/extend.texi
@@ -670,16 +670,21 @@ tester (int len; char data[len][len], int len)
@end smallexample
@cindex parameter forward declaration
-The @samp{int len} before the semicolon is a @dfn{parameter forward
-declaration}, and it serves the purpose of making the name @code{len}
-known when the declaration of @code{data} is parsed.
+The @samp{int len} before the semicolon
+is a @dfn{parameter forward declaration},
+and it serves the purpose of making the name @code{len} known
+when the declaration of @code{data} is parsed.
-You can write any number of such parameter forward declarations in the
-parameter list. They can be separated by commas, and the
-last one must end with a semicolon, which is followed by the ``real''
-parameter declarations. Each forward declaration must match a ``real''
-declaration in parameter name and data type. ISO C99 does not support
-parameter forward declarations.
+Lists of parameter forward declarations are separated by semicolons,
+and parameters are separated within such lists by commas,
+just like in the regular parameter declaration list.
+
+You can write any number of such parameter forward declaration lists,
+but using more than one is obsolete and unnecessary.
+The last semicolon is followed by the ``real'' parameter declarations.
+Each forward declaration must match
+a ``real'' declaration in parameter name and data type.
+ISO C99 does not support parameter forward declarations.
@node Zero Length
@subsection Arrays of Length Zero
Cheers,
Alex
--
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).
signature.asc
Description: PGP signature
