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: 1707099 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=bKEk4VAz; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NG3DC58cjz23nY for ; Mon, 21 Nov 2022 21:15:07 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AE19C384D9BF for ; Mon, 21 Nov 2022 10:15:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE19C384D9BF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669025704; bh=Gz23qOvFEbrqLdPbIwmneVuavFF9pMtJwMGJ7wPUdd4=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=bKEk4VAz8x/KcPMeYyQyDGSSjbQQkhl6HaRnhVhnXzZKT7pYq1Uw3JuwnKL4EpviH Y0OuNdfz0QThEmPozlyHblNiRkHtAzA4Bp1uUieml+LMNgC1dRtwZNDNQhN1skvvlF ZT4/8PRcrP5/Cj5DfLWpTjEf4gBOUxaCLj+lrr70= 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-Google-Smtp-Source: AA0mqf494uunsFkrZvxokYfR2WqXfynjMU2wfOSojKAA9EwZ+EGxymOCoF5cLxn//+A5XaFsUQHltQ== 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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)