From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686247037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=msa4L+Z2YmAPCQLCuYp+EcAabYGxOfa1k74Gu+huLnc=; b=VwxGyEwHRwfm0wQ4Ysj7F8iJKr8QL8Sr8ZrHHUr4hnSWbRHi1yBWdiGgm/l+KhlbA9r6W/ Xnka+iehMfJn2MtYTdesLvm1/kWJBaiEmXZfuPfbzRiW1ZU/v3znZMmMOBziCUD88TVBC0 HUmrFacgd+qt/oGBWP3lYTwE2DDr8Ec= 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) From: Marek Polacek 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 List-Id: 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(-) 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; @}; base-commit: 1379ae33e05c28d705f3c69a3f6c774bf6e83136 -- 2.40.1