From patchwork Thu Jun 8 17:57:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 70796 Return-Path: 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 A8956385773C for ; Thu, 8 Jun 2023 17:57:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8956385773C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686247065; bh=msa4L+Z2YmAPCQLCuYp+EcAabYGxOfa1k74Gu+huLnc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=JhsJGQQqwEzlgH8kTfRRLXuDPAwiXvYbXxi0InKk+hExtXjveyROPRiw1u1hhE32H SEWEPuy5Tg8CR+hDxVKGHe3L2F91P3tnEypmmObORfJk5BKFNU515ffe+rXhM2ZIlt kRgpJzBDcN/ZH/8+dLLULv+1FUndw5JqkdI71nks= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 1E25D3858C20 for ; Thu, 8 Jun 2023 17:57:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E25D3858C20 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-424-BXP7NnV7NcudoWXmUWYRdw-1; Thu, 08 Jun 2023 13:57:16 -0400 X-MC-Unique: BXP7NnV7NcudoWXmUWYRdw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 09CE12A5954A for ; Thu, 8 Jun 2023 17:57:16 +0000 (UTC) Received: from pdp-11.redhat.com (unknown [10.22.9.219]) by smtp.corp.redhat.com (Postfix) with ESMTP id E79CF1121314 for ; Thu, 8 Jun 2023 17:57:15 +0000 (UTC) To: GCC Patches Subject: [PATCH] doc: Clarification for -Wmissing-field-initializers Date: Thu, 8 Jun 2023 13:57:09 -0400 Message-Id: <20230608175709.462490-1-polacek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Marek Polacek via Gcc-patches From: Marek Polacek Reply-To: Marek Polacek Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The manual is incorrect in saying that the option does not warn about designated initializers, which it does in C++. Whether the divergence in behavior is desirable is another thing, but let's at least make the manual match the reality. PR c/39589 PR c++/96868 gcc/ChangeLog: * doc/invoke.texi: Clarify that -Wmissing-field-initializers doesn't warn about designated initializers in C only. --- gcc/doc/invoke.texi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) base-commit: 1379ae33e05c28d705f3c69a3f6c774bf6e83136 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 6d08229ce40..0870f7aff93 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -9591,8 +9591,9 @@ struct s @{ int f, g, h; @}; struct s x = @{ 3, 4 @}; @end smallexample -This option does not warn about designated initializers, so the following -modification does not trigger a warning: +@c It's unclear if this behavior is desirable. See PR39589 and PR96868. +In C this option does not warn about designated initializers, so the +following modification does not trigger a warning: @smallexample struct s @{ int f, g, h; @};