| Message ID | cover.1758005347.git.alx@kernel.org |
|---|---|
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CFF35385700E for <patchwork@sourceware.org>; Tue, 16 Sep 2025 06:57:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFF35385700E Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=bdg2wqpe X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by sourceware.org (Postfix) with ESMTPS id E9DB03857359 for <gcc-patches@gcc.gnu.org>; Tue, 16 Sep 2025 06:53:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E9DB03857359 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E9DB03857359 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.105.4.254 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758005585; cv=none; b=KqNDTAauohs6HjYruxmQKioeL//g5VM3SUX+WjAchUVMB8cxrOaz23SlrjoXVl5k291sF9/XUNTLxUeVEF2n/K47LHg+XZetwv1hkqs9nMygNToml855nQzClwR/dYbmarq/8Od7NmbWofOIb/6D6acrDj5pvSPAeSgNRiPac0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758005585; c=relaxed/simple; bh=FAtnGdCrVbvXpUl8xV8uOowbywyYnpYujJwLsiGe+Mo=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=mzWXZDFtXzN/ogOBaVBcb4aGjwup7YCcl1nOmyccNyFZ14g1pfkHzE49JOvcRP0W2RyE/ixdnIKBJA6/fRf9ssFk8GkAEamQBKNkOb5nFYciDgnbjMIcbUhvf9UPGncfeTCurBweyS3oBs8/84i+Lj/Y5ZJ67cwA5UJKDJwOG5Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E9DB03857359 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 9503F60191; Tue, 16 Sep 2025 06:53:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35570C4CEEB; Tue, 16 Sep 2025 06:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758005584; bh=FAtnGdCrVbvXpUl8xV8uOowbywyYnpYujJwLsiGe+Mo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bdg2wqpeCbYV32yCC4DNjlqCS/BhnAmn9ggwWNl1Wc9tITggU/ZxF/v2wYPf4wybJ OueDTwnmEV+qEOh1OQc8lD43LlhEX8DLZhg46CNs9pLmQ9YGSCqDLcs9oga5FvEcio H9GTWRuR1oT968PPdEQTLnDJDtEtI4KHB+75iQ+aT7558BqI7mPMWVi7V1KRX+OoVd Yz13XXVMWN8kX4oUDXIsJbt47JCYwdUAy8aJEYisZSUccooMWQJ1otLpcl9alnuoZc eMmCdM4zyBXgNt1pr8chK6vAO9BIxiikNvYOhsxwdh37E50AMmtosJXKR41urSgM8L r5Cm19uIAVcAw== Date: Tue, 16 Sep 2025 08:52:59 +0200 From: Alejandro Colomar <alx@kernel.org> To: gcc-patches@gcc.gnu.org Cc: Alejandro Colomar <alx@kernel.org>, Christopher Bazley <chris.bazley.wg14@gmail.com>, Martin Uecker <uecker@tugraz.at>, Joseph Myers <josmyers@redhat.com> Subject: [PATCH v5 0/1] c, objc: Add -Wmultiple-parameter-fwd-decl-lists Message-ID: <cover.1758005347.git.alx@kernel.org> X-Mailer: git-send-email 2.50.1 References: <fd77f2ea556c6adfc3491ad10aa4989a2d7244b7.1757169278.git.alx@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <fd77f2ea556c6adfc3491ad10aa4989a2d7244b7.1757169278.git.alx@kernel.org> X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org |
| Series |
c, objc: Add -Wmultiple-parameter-fwd-decl-lists
|
|
Message
Alejandro Colomar
Sept. 16, 2025, 6:52 a.m. UTC
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}.