Hi Joseph,
I've fixed the documentation (compared to what I suggested on the list,
I've removed the obsolescence mention, and I've s/separated/terminated/
which I think is more accurate about the semicolon in lists of parameter
forward declarations).
I've also added extend.texi to the ChangeLog, as it seems I had
forgotten it.
Have a lovely day!
Alex
Alejandro Colomar (1):
c, objc: Add -Wmultiple-parameter-fwd-decl-lists
gcc/c-family/c.opt | 4 ++++
gcc/c/c-decl.cc | 16 +++++++------
gcc/doc/extend.texi | 23 +++++++++++--------
gcc/doc/invoke.texi | 12 +++++++++-
.../Wmultiple-parameter-fwd-decl-lists.c | 6 +++++
5 files changed, 44 insertions(+), 17 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/Wmultiple-parameter-fwd-decl-lists.c
Range-diff against v4:
1: 3370790e940 ! 1: a5122b1110e c, objc: Add
-Wmultiple-parameter-fwd-decl-lists
@@ Commit message
gcc/ChangeLog:
+ * doc/extend.texi: Clarify documentation about lists of
+ parameter forward declarations, and mention that more than one
+ of them are unnecessary.
* doc/invoke.texi: Document the new
-Wmultiple-parameter-fwd-decl-lists.
@@ gcc/c/c-decl.cc: mark_forward_parm_decls (void)
if (TREE_CODE (b->decl) == PARM_DECL)
## gcc/doc/extend.texi ##
-@@ gcc/doc/extend.texi: declaration}, and it serves the purpose of making
the name @code{len}
- known when the declaration of @code{data} is parsed.
+@@ gcc/doc/extend.texi: tester (int len; char data[len][len], int len)
+ @end smallexample
- You can write any number of such parameter forward declarations in the
+ @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 or semicolons, but 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
+-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 terminated 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 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
## gcc/doc/invoke.texi ##
@@ gcc/doc/invoke.texi: Objective-C and Objective-C++ Dialects}.
--
2.50.1