From patchwork Mon Nov 21 10:13:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 23641 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1493642wrr; Mon, 21 Nov 2022 02:16:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf4dLQBPYTMiGacHIO5AEg9NqpdZPVqSFTEjipwulHPmNW7O6dxG0r09v2SiMR+lqtMHdfD7 X-Received: by 2002:a17:906:eb04:b0:7ae:77ef:d048 with SMTP id mb4-20020a170906eb0400b007ae77efd048mr14944519ejb.740.1669025785774; Mon, 21 Nov 2022 02:16:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669025785; cv=none; d=google.com; s=arc-20160816; b=tISPfszA0VXY2GWYr9cjnKDktH01lPRWc/ZG7LBY9g03cqdDlh5MyAl7ilU+qwP2El Q3UqfBR8XiaOqdydWr3WJNQT/n3FeYmpbA6iG/5A9x17pncPapX3xM+at8lYj/yinEgs ChGQiKRQP0q3vZJY26Kth7obWTO7DtMErSTHvkxTgDDHLYXxO7dMxUoeVLdF47C357+p 2wEsN21NWFMzIdx/B/xSCjXyNv+gHg3Up898uJcqe5ddFdUcBahbRbw8PvIwAahNp6p9 STZrAbXv5nFErjniJtZsJpH392AhDhgsS9pQ+8fEZsZhJVoH7Sfj2JBdDvWVGralpCwk YY7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=Gz23qOvFEbrqLdPbIwmneVuavFF9pMtJwMGJ7wPUdd4=; b=beU8kC0ORLqZ4zQQvsfmsV1v1YHb/MN3HBzFQPsxIWOVFSgPE/8b9/95Dg+vNQ0j3L P46xzNPMGPfJlfSO2UK+Br0YmwMXaRvTz98hzypi+oKRWoBTKot9aTfW68X0eQetdGd9 RHsHQEfxTwGp+/ROgRgtDX8YBK7i2aAG8HE4TtAfWsdq8bwd7Lz6Rf+sq0g1ZEcFKOPY B/gXRo7tXZ4aFIOkyZGDQ6nvxwWqoNcMRhg7LMu+a/jzL+d+OsZVai93NcHxvgWaqBpO 67LkCY3s4KplICMorqnFPUPwAUxlcXKSk9T4qzzoa34CH+vmzzKoea+VQuCfV6vJpJo/ 2UOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=J0sWcswI; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id qk30-20020a1709077f9e00b0078da5f6ed9esi5525226ejc.779.2022.11.21.02.16.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 02:16:25 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=J0sWcswI; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D58EC384B02A for ; Mon, 21 Nov 2022 10:15:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D58EC384B02A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669025735; bh=Gz23qOvFEbrqLdPbIwmneVuavFF9pMtJwMGJ7wPUdd4=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=J0sWcswIA6/by0jFso2ziosqdFuwBSzXxaz6A7SAhYMc8whXl6JHp+9a69ohsGOSb eAXrCJNBEsDBHaQD2VlxvmjPRx2Kp0K4Ht2fSTlLgWfVYbkDnc8jYjkKHna46+225m m5bgag3LTWtEkOUevfuc7xbRoiAV717tDjBl7OMA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 34C30384F494 for ; Mon, 21 Nov 2022 10:14:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 34C30384F494 Received: by mail-wm1-x32a.google.com with SMTP id t25-20020a1c7719000000b003cfa34ea516so10066099wmi.1 for ; Mon, 21 Nov 2022 02:14:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Gz23qOvFEbrqLdPbIwmneVuavFF9pMtJwMGJ7wPUdd4=; b=yJi17CNKg/4HMR5OoX04tQTmTkyIFNMfCS0x+L5ShrYQo3FLIxV9fRsPJRs5TlC+vH rYgSLdgGq8TE/PrCLQrUqwXggYXx9lSEPXEEqrd6iSg14UEe0wRiLMlaC3O+KnPNqdj9 THCjZhRySnHU/AVN03py9xQKJVxzVn3Y5KpMc7sMktsGOCvGwjqkjgKCWznreibohkDw 7v+t85UrozgqT3nq7Lzviv2/iYxATaaBOMFdsYCtk+7+Chmh+aeSgLCxiYmsszryOExA 2PXljo5y/d3O4vsPOYzmWBr8pF+ZsNKUvqZRhkg7Y7/OFnSfcfpwA7Vf3zmxsjPvRs9h MDtA== X-Gm-Message-State: ANoB5pku/OIBhkBunMs5XErtKcxgXI6wm5ReMp7RHeKrXbjFg3fjQEpo WcMKJtJVtSqw79j/G3MFbnQXuwoC69aEBg== X-Received: by 2002:a05:600c:4e8d:b0:3c7:6e1:b5c9 with SMTP id f13-20020a05600c4e8d00b003c706e1b5c9mr5672588wmq.154.1669025638972; Mon, 21 Nov 2022 02:13:58 -0800 (PST) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id q2-20020adffec2000000b00241d544c9b1sm3463717wrs.90.2022.11.21.02.13.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 02:13:58 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Steve Baird Subject: [COMMITTED] ada: Improve documentation for -gnatw.h warnings Date: Mon, 21 Nov 2022 11:13:56 +0100 Message-Id: <20221121101356.259145-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750100382093899780?= X-GMAIL-MSGID: =?utf-8?q?1750100382093899780?= From: Steve Baird The -gnatw.h option enables warnings about "gaps" in record layout specifications. In the case of a "partial" layout specification, where the locations of some components are left unspecified, the resulting warnings may be incomplete or incorrect. Document this implementation limitation. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Improve the description of how the -gnatw.h switch interacts with "partial" record layout specifications (i.e., specifications where the locations of some components are left unspecified). * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../building_executable_programs_with_gnat.rst | 9 +++++++-- gcc/ada/gnat_ugn.texi | 11 ++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst index 87fb1087e42..fe0b567c2b9 100644 --- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst +++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst @@ -3221,8 +3221,13 @@ of the pragma in the :title:`GNAT_Reference_manual`). This switch activates warnings on component clauses in record representation clauses that leave holes (gaps) in the record layout. - If this warning option is active, then record representation clauses - should specify a contiguous layout, adding unused fill fields if needed. + If a record representation clause does not specify a location for + every component of the record type, then the warnings generated (or not + generated) are unspecified. For example, there may be gaps for which + either no warning is generated or a warning is generated that + incorrectly describes the location of the gap. This undesirable situation + can sometimes be avoided by adding (and specifying the location for) unused + fill fields. .. index:: -gnatw.H (gcc) diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 2f43b4f71c8..12eb494d40d 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -19,7 +19,7 @@ @copying @quotation -GNAT User's Guide for Native Platforms , Nov 14, 2022 +GNAT User's Guide for Native Platforms , Nov 18, 2022 AdaCore @@ -11305,8 +11305,13 @@ This switch suppresses warnings on hiding declarations. This switch activates warnings on component clauses in record representation clauses that leave holes (gaps) in the record layout. -If this warning option is active, then record representation clauses -should specify a contiguous layout, adding unused fill fields if needed. +If a record representation clause does not specify a location for +every component of the record type, then the warnings generated (or not +generated) are unspecified. For example, there may be gaps for which +either no warning is generated or a warning is generated that +incorrectly describes the location of the gap. This undesirable situation +can sometimes be avoided by adding (and specifying the location for) unused +fill fields. @end table @geindex -gnatw.H (gcc)