From patchwork Fri Aug 2 07:11:18 2024 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: 95156 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 35BE3385E839 for ; Fri, 2 Aug 2024 07:13:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 9195E385DDFE for ; Fri, 2 Aug 2024 07:12:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9195E385DDFE Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9195E385DDFE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::435 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582745; cv=none; b=lSQuSbOe0d3CNlUL+XjmUeZAjuYwqMNOvfz1aP0pAqIIUW1/nQ6s3wkeI/uT+gv84N2u0EwIuwVXZuaS+TWoeD8Hs0XrjzCslBfSjmJKkWsSillhNDNiCyctWwN78/O0OChi6x1bXaDTZ+UhGle7vBEsyw+6VHqhBOJ3Q9p5zIs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582745; c=relaxed/simple; bh=HRCNpdEbOgNk5Q9z4hr9Rq6+V4q1jHy/ctyt30qBcV4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=iX8MX5v8x5KONAA/bxL4kkjfX3japBwFtvK6N4ZSIB3S48Wqy+Fz111zVPYAgzAbDFtlqYVBN1sidwZ5o0ToYQUiE74olKDQdv1MsOrZPfQsLFBD9PEy4E/2HUhU/fH1KR6XxJvm1Ejd2ZpkBG6qbSdyKtDEC7lu0AEtPtJW71Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3684e8220f9so1577642f8f.1 for ; Fri, 02 Aug 2024 00:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582742; x=1723187542; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=DWddsJHqoPCJIGonGOgojn/wrP6TSUdvkatp9teyV4w=; b=clKh1C+ju5ZNZjqRTPXH1+vROPnSeUxdTtrGhodUL39f+4pYc0UXs8mfD8DQ8x+QGx th9gyGZxGDpKnxOCmuJM3EdMi0KjqN67oLcVe4MKdXdZPGPk4/5911+aeurSXnFvkEe2 +C93aThvK/9J6Go4k50PsB6WdYdszd7gqi8Ou10sBBZi+Rom4B8va4GJDa0ElZX6WtU5 /D8kK/ibc8x7i06lsdhhIgQoyQomGvSrdPww86eJbYRk0pF1g9HIL+LZ61Or5wE5qhC7 zE08rap1ECUJiIixWIjfSnfrymdv6yjybXDVXr1pA0hA0ffUonbZw4Sg1kGzgAB/uuPX 4Xpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582742; x=1723187542; 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=DWddsJHqoPCJIGonGOgojn/wrP6TSUdvkatp9teyV4w=; b=ba8rHzfeorM+QuOCn5n0ovRg/WqI4jnvV89MJ4uhFgr4rA7EiEyQcUA8a7l/2CdOFM 8G0PvHlS61E/t0tUhfT4Y4LTxvmuGtx1W0BE0FqhGXUiqpbPcYVbrGWHWuXfWIYA3a2D oY7EzAIqsHv2dXGn4BLZlcMFAjlvx5UncCqg1o+hF2DukR+4GKMlVcUArxzFRu0c4JOM fregTfZjYgGmO29WQBFQ/vLQIaxgMJ+Z8lidwDFfQ+Lut46IBbSlDRMlzZHPBiYtaNAZ pLE+Wb3/qU5uzsu/3FuBJBaakIcbm6XZBV2TU+TmnBPuF1BcUR8PXeqXsNLayXEUAIbS Dvkw== X-Gm-Message-State: AOJu0Yzd/pIHTP8njA807j/UKy24Bi4zvn4/JNqwIJVf1MQsEeD3d0ZU XWOrSS5PTls0H0sDy8iiMYq+QHPHGoWkyapw1BzDwCRX8V0MhxJFHGzHhi+Cf7B1WwAmrVtEAgW sbw== X-Google-Smtp-Source: AGHT+IEmnksPXOnOPyMBcGARSX5gju+FjDBcHcLXnaeiKq7G4rwVnViqpwcHUHMTpdK4WE7jlmGcQw== X-Received: by 2002:adf:ab09:0:b0:366:dee6:a9ea with SMTP id ffacd0b85a97d-36bb35de1c4mr3205621f8f.26.1722582742017; Fri, 02 Aug 2024 00:12:22 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:21 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 01/26] ada: Fix detection of suspicious loop patterns Date: Fri, 2 Aug 2024 09:11:18 +0200 Message-ID: <20240802071210.413366-1-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Ronan Desplanques This patch fixes an assertion failure in some cases in the code to warn about possible misuse of range attributes in loop. The root of the problem is that this code failed to consider the case where the outer loop is a while loop. Also fix a typo in a nearby comment. gcc/ada/ * sem_ch5.adb (Analyze_Loop_Statement): Fix loop pattern detection code. Fix typo. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch5.adb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index e4506036cc2..4db3a1a26ee 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -3967,7 +3967,7 @@ package body Sem_Ch5 is Push_Scope (Ent); Analyze_Iteration_Scheme (Iter); - -- Check for following case which merits a warning if the type E of is + -- Check for following case which merits a warning if the type of E is -- a multi-dimensional array (and no explicit subscript ranges present). -- for J in E'Range @@ -3992,6 +3992,10 @@ package body Sem_Ch5 is and then Number_Dimensions (Typ) > 1 and then Nkind (Parent (N)) = N_Loop_Statement and then Present (Iteration_Scheme (Parent (N))) + -- The next conjunct tests that the enclosing loop is + -- a for loop and not a while loop. + and then Present (Loop_Parameter_Specification + (Iteration_Scheme (Parent (N)))) then declare OIter : constant Node_Id := From patchwork Fri Aug 2 07:11:19 2024 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: 95157 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 7B5B53860008 for ; Fri, 2 Aug 2024 07:13:26 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id DD36B385DDF9 for ; Fri, 2 Aug 2024 07:12:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DD36B385DDF9 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DD36B385DDF9 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582751; cv=none; b=C0JU+kfI7SnAWy6HCKpgiyHDFm/hMFMfwNi0V9+8zJJ0EjzAxMvv38Ln2w8zzGC1swb6/HXlBt6TcT9Ons8KsHXeKOBwHK3KAHwihxuuexRI+ChcNcxHTU7vyNbO3TURCUVqFjh2YJnRaTHr0vQMt5Y41WXx2UedsUjr+S0rAIU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582751; c=relaxed/simple; bh=kidiAKX7enstUeW/GE2MiaTX17mKlFD+9fe+IrRFTMk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dTsMCZyvUPaeLFw3/V/+lQ1OgGHfWT3ggeptfjCO7oUwYKo9tc/Nd06RKv5ZV+K+aeXyLGYqlKOmTF6dfYSwKIcN5WrKI4na6DGGVaVeaV1TbYD/2XODwJ9RDs2ET4qvWA/SJhAUPnYBTq3yfCMmVZkOBkdSKHQ07pUJnqxSE/Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-36865a516f1so5383102f8f.0 for ; Fri, 02 Aug 2024 00:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582743; x=1723187543; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6JJPW50X8MBBczZ2qm+D3mnieIFl5iz+nBqPjZ3/wZM=; b=V1pdKtZI8hnbsT/xRAPLRjq+AP0ZVUyAWs5VuyCIsJaBCA7HVbIhQ2dNdQxjYzbAiz OmSUOLFijDknbH4Hzyl2c+yjSR7pWjdJa82yTFSBOHUqZQobzKKm7G4DHCoduuWgQ7Fm 95qbGnflna78/Ez7pu0tw7avcEkylp1bzDxl4FoDsrBWoY9Ji7F5JcdAj6bxjzZ6l0im Z7z36JRU4CPmnIGJRdgjY0Rqi+f94eIFPuicZbUqt1mSm9lzRfCBtPhE0JW88z25c9Uz TQB0ERtCcT+03MnF3ontoIil6zUhTt6FqHyGEh4dyLm0L0HXqMon8zB03EtTpUqaV00d PWBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582743; x=1723187543; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6JJPW50X8MBBczZ2qm+D3mnieIFl5iz+nBqPjZ3/wZM=; b=pfmSOiKBUnxbiQiEYdxxO2tU/1J1GV2/4XXqmsQP6Iyttj+Uct3QKKPaTv7K1UQuSF oJBVu9wrfqmBjhsfS44HI7jxoRrk2ld7gBphPfCKOacExJpLudsmajSUN4Y04SJTg6tA 9opqtQ6FeJPCf2glG2oddvB8k0NnSaDD5KoZCeIsno0gwBL/CYxi7A6bVEBnlg3gWiHk z8HNCJ2gJFHK3V8FinGF5gHpVHirQlIGknp+gM7QcTEGeB1nMKvBWH9XmkLfSjbXnUPw mEd79V+11Z2QUh3GBdKFs4IZNcc+u6IzPb2o4Fks4eQSDrm/duuuMg6DW3whgWX0RstP O57Q== X-Gm-Message-State: AOJu0YzUmF4c1R9hNKf9Dss4Al7ywU9OMS7Rv8hXPnjtr9Ja9b6YqlPW fbaAOS/HoWh7kHNe8DYNDem5pkjbOovoPQDV1OgqmtSmHHKVwa7WMb57soghMWiw3Gi7ltpaONX b2g== X-Google-Smtp-Source: AGHT+IG4ouf6rMCZr5/d1UoiM8hM96y55JRRjGZpaIUUUF5vN0zchTQD0v2udCR6+0TNegrx7jZQqA== X-Received: by 2002:a05:6000:1a8f:b0:368:3384:e9da with SMTP id ffacd0b85a97d-36bbc1ddfdfmr1758383f8f.62.1722582742947; Fri, 02 Aug 2024 00:12:22 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:22 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 02/26] ada: Fix crash on expression function returning tagged type in nested package Date: Fri, 2 Aug 2024 09:11:19 +0200 Message-ID: <20240802071210.413366-2-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou This happens when the expression is a reference to a formal parameter of the function, or a conditional expression with such a reference as one of its dependent expressions, because the RM 6.5(8/5) subclause prescribes a tag reassignment in this case, which requires freezing the tagged type in the GNAT freezing model, although the language says there is no freezing. In other words, it's another occurrence of the discrepancy between this model tailored to Ada 95 and the freezing rules introduced in Ada 2012, that is papered over by Should_Freeze_Type and the associated processing. gcc/ada/ * exp_util.ads (Is_Conversion_Or_Reference_To_Formal): New function declaration. * exp_util.adb (Is_Conversion_Or_Reference_To_Formal): New function body. * exp_ch6.adb (Expand_Simple_Function_Return): Call the predicate Is_Conversion_Or_Reference_To_Formal in order to decide whether a tag check or reassignment is needed. * freeze.adb (Should_Freeze_Type): Move declaration and body to the appropriate places. Also return True for tagged results subject to the expansion done in Expand_Simple_Function_Return that is guarded by the predicate Is_Conversion_Or_Reference_To_Formal. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch6.adb | 9 +-- gcc/ada/exp_util.adb | 16 ++++ gcc/ada/exp_util.ads | 4 + gcc/ada/freeze.adb | 180 ++++++++++++++++++++++++++----------------- 4 files changed, 130 insertions(+), 79 deletions(-) diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 548589284e2..9c182b2c6b4 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -6989,14 +6989,7 @@ package body Exp_Ch6 is if Present (Utyp) and then Is_Tagged_Type (Utyp) and then not Is_Class_Wide_Type (Utyp) - and then (Nkind (Exp) in - N_Type_Conversion | N_Unchecked_Type_Conversion - or else (Nkind (Exp) = N_Explicit_Dereference - and then Nkind (Prefix (Exp)) in - N_Type_Conversion | - N_Unchecked_Type_Conversion) - or else (Is_Entity_Name (Exp) - and then Is_Formal (Entity (Exp)))) + and then Is_Conversion_Or_Reference_To_Formal (Exp) then -- When the return type is limited, perform a check that the tag of -- the result is the same as the tag of the return type. diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index de096ea752a..c5d3af7545e 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -8560,6 +8560,22 @@ package body Exp_Util is end if; end Is_Captured_Function_Call; + ------------------------------------------ + -- Is_Conversion_Or_Reference_To_Formal -- + ------------------------------------------ + + function Is_Conversion_Or_Reference_To_Formal (N : Node_Id) return Boolean + is + begin + return Nkind (N) in N_Type_Conversion | N_Unchecked_Type_Conversion + or else (Nkind (N) = N_Explicit_Dereference + and then Nkind (Prefix (N)) in N_Type_Conversion + | N_Unchecked_Type_Conversion) + or else (Is_Entity_Name (N) + and then Present (Entity (N)) + and then Is_Formal (Entity (N))); + end Is_Conversion_Or_Reference_To_Formal; + ------------------------------ -- Is_Finalizable_Transient -- ------------------------------ diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index c772d411bcf..7fbbe5fc9fd 100644 --- a/gcc/ada/exp_util.ads +++ b/gcc/ada/exp_util.ads @@ -769,6 +769,10 @@ package Exp_Util is -- Rnn : constant Ann := Func (...)'reference; -- Rnn.all + function Is_Conversion_Or_Reference_To_Formal (N : Node_Id) return Boolean; + -- Return True if N is a type conversion, or a dereference thereof, or a + -- reference to a formal parameter. + function Is_Finalizable_Transient (Decl : Node_Id; N : Node_Id) return Boolean; diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index cf7a22efcae..c8d20d020c7 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -185,77 +185,6 @@ package body Freeze is -- the designated type. Otherwise freezing the access type does not freeze -- the designated type. - function Should_Freeze_Type - (Typ : Entity_Id; E : Entity_Id; N : Node_Id) return Boolean; - -- If Typ is in the current scope, then return True. - -- N is a node whose source location corresponds to the freeze point. - -- ??? Expression functions (represented by E) shouldn't freeze types in - -- general, but our current expansion and freezing model requires an early - -- freezing when the dispatch table is needed or when building an aggregate - -- with a subtype of Typ, so return True also in this case. - -- Note that expression function completions do freeze and are - -- handled in Sem_Ch6.Analyze_Expression_Function. - - ------------------------ - -- Should_Freeze_Type -- - ------------------------ - - function Should_Freeze_Type - (Typ : Entity_Id; E : Entity_Id; N : Node_Id) return Boolean - is - function Is_Dispatching_Call_Or_Aggregate - (N : Node_Id) return Traverse_Result; - -- Return Abandon if N is a dispatching call to a subprogram - -- declared in the same scope as Typ or an aggregate whose type - -- is Typ. - - -------------------------------------- - -- Is_Dispatching_Call_Or_Aggregate -- - -------------------------------------- - - function Is_Dispatching_Call_Or_Aggregate - (N : Node_Id) return Traverse_Result is - begin - if Nkind (N) = N_Function_Call - and then Present (Controlling_Argument (N)) - and then Scope (Entity (Original_Node (Name (N)))) - = Scope (Typ) - then - return Abandon; - elsif Nkind (N) in N_Aggregate - | N_Extension_Aggregate - | N_Delta_Aggregate - and then Base_Type (Etype (N)) = Base_Type (Typ) - then - return Abandon; - else - return OK; - end if; - end Is_Dispatching_Call_Or_Aggregate; - - ------------------------- - -- Need_Dispatch_Table -- - ------------------------- - - function Need_Dispatch_Table is new - Traverse_Func (Is_Dispatching_Call_Or_Aggregate); - -- Return Abandon if the input expression requires access to - -- Typ's dispatch table. - - Decl : constant Node_Id := - (if No (E) then E else Original_Node (Unit_Declaration_Node (E))); - - -- Start of processing for Should_Freeze_Type - - begin - return Within_Scope (Typ, Current_Scope) - or else (Nkind (N) = N_Subprogram_Renaming_Declaration - and then Present (Corresponding_Formal_Spec (N))) - or else (Present (Decl) - and then Nkind (Decl) = N_Expression_Function - and then Need_Dispatch_Table (Expression (Decl)) = Abandon); - end Should_Freeze_Type; - procedure Process_Default_Expressions (E : Entity_Id; After : in out Node_Id); @@ -282,6 +211,17 @@ package body Freeze is -- attribute definition clause occurs, then these two flags are reset in -- any case, so call will have no effect. + function Should_Freeze_Type + (Typ : Entity_Id; + E : Entity_Id; + N : Node_Id) return Boolean; + -- True if Typ should be frozen when the profile of E is being frozen at N. + + -- ??? Expression functions that are not completions shouldn't freeze types + -- but our current expansion and freezing model requires an early freezing + -- when the tag of Typ is needed or for an aggregate with a subtype of Typ, + -- so we return True in these cases. + procedure Undelay_Type (T : Entity_Id); -- T is a type of a component that we know to be an Itype. We don't want -- this to have a Freeze_Node, so ensure it doesn't. Do the same for any @@ -10592,6 +10532,104 @@ package body Freeze is end if; end Set_SSO_From_Default; + ------------------------ + -- Should_Freeze_Type -- + ------------------------ + + function Should_Freeze_Type + (Typ : Entity_Id; + E : Entity_Id; + N : Node_Id) return Boolean + is + Decl : constant Node_Id := Original_Node (Unit_Declaration_Node (E)); + + function Is_Dispatching_Call_Or_Tagged_Result_Or_Aggregate + (N : Node_Id) return Traverse_Result; + -- Return Abandon if N is a dispatching call to a subprogram + -- declared in the same scope as Typ, or a tagged result that + -- needs specific expansion, or an aggregate whose type is Typ. + + function Check_Freezing is new + Traverse_Func (Is_Dispatching_Call_Or_Tagged_Result_Or_Aggregate); + -- Return Abandon if the input expression requires freezing Typ + + function Within_Simple_Return_Statement (N : Node_Id) return Boolean; + -- Determine whether N is the expression of a simple return statement, + -- or the dependent expression of a conditional expression which is + -- the expression of a simple return statement, including recursively. + + ------------------------------------------------------- + -- Is_Dispatching_Call_Or_Tagged_Result_Or_Aggregate -- + ------------------------------------------------------- + + function Is_Dispatching_Call_Or_Tagged_Result_Or_Aggregate + (N : Node_Id) return Traverse_Result + is + begin + if Nkind (N) = N_Function_Call + and then Present (Controlling_Argument (N)) + and then Scope (Entity (Original_Node (Name (N)))) = Scope (Typ) + then + return Abandon; + + -- The expansion done in Expand_Simple_Function_Return will assign + -- the tag to the result in this case. + + elsif Is_Conversion_Or_Reference_To_Formal (N) + and then Within_Simple_Return_Statement (N) + and then Etype (N) = Typ + and then Is_Tagged_Type (Typ) + and then not Is_Class_Wide_Type (Typ) + then + return Abandon; + + elsif Nkind (N) in N_Aggregate + | N_Delta_Aggregate + | N_Extension_Aggregate + and then Base_Type (Etype (N)) = Base_Type (Typ) + then + return Abandon; + + else + return OK; + end if; + end Is_Dispatching_Call_Or_Tagged_Result_Or_Aggregate; + + ------------------------------------ + -- Within_Simple_Return_Statement -- + ------------------------------------ + + function Within_Simple_Return_Statement (N : Node_Id) return Boolean is + Par : constant Node_Id := Parent (N); + + begin + if Nkind (Par) = N_Simple_Return_Statement then + return True; + + elsif Nkind (Par) = N_Case_Expression_Alternative then + return Within_Simple_Return_Statement (Parent (Par)); + + elsif Nkind (Par) = N_If_Expression + and then N /= First (Expressions (Par)) + then + return Within_Simple_Return_Statement (Par); + + else + return False; + end if; + end Within_Simple_Return_Statement; + + -- Start of processing for Should_Freeze_Type + + begin + return Within_Scope (Typ, Current_Scope) + or else (Nkind (N) = N_Subprogram_Renaming_Declaration + and then Present (Corresponding_Formal_Spec (N))) + or else (Present (Decl) + and then Nkind (Decl) = N_Expression_Function + and then Check_Freezing (Expression (Decl)) = Abandon); + end Should_Freeze_Type; + ------------------ -- Undelay_Type -- ------------------ From patchwork Fri Aug 2 07:11:20 2024 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: 95159 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 63ECC385F027 for ; Fri, 2 Aug 2024 07:13:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by sourceware.org (Postfix) with ESMTPS id B671B385E441 for ; Fri, 2 Aug 2024 07:12:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B671B385E441 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B671B385E441 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::133 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582751; cv=none; b=g4cugxUHjtCk39JfnuMPYpBVZtqXN8oxFo2htuXhipF5OJW4sIF2vxtTxnfQAUqvkDlqW+d+IKaXE2V53OznPm0XjuhPs40yxuATIWo8A28Gw2i0b6dwQxkC2Lf+2paLhZ4ErpBf7Sph8tNj+IvjfS5Z6k3zoKvvyIR/A+bErYE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582751; c=relaxed/simple; bh=DgBKx5/Fscv7+1zXSnvDzDlxgHkpumm9wvnscGtmUIs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=IL54SPII9PMt+WJFv/Hzh+HjPJviiuv/LSyFepAu/TOZibBbg92XpMaXLaxST7fKOkYv6MIKn2rH/DhnADJIIAQnZrYEP+s1v66CA+wGlOVQNof2DWzzPhWdnwfHW6z5QHcvDtKjMXssZ//wSxeA0VuazaLK6eUqHcRGzC8GQOI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-52f01b8738dso8069567e87.1 for ; Fri, 02 Aug 2024 00:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582744; x=1723187544; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pQxehbjRCiGB0oMWs2FMmk72//7m3x//vhWw/Ey0KJ8=; b=ZHfwekb9Sb5yoCc1NpAWGfsVOxpMVvp3UlqIx7pAbdfAsnLdd1h6IK6k1Jgo4lCyLC oyT42rh/l+s3IInzQyOG5LL8A+at5XhVJlVwqenC89C5DM9LqS0T6T7VD1bFgR+zcXNf 7tBM4zZMzTAc05cATBYR8URC7j9++/pyqR140sfAfaTE6jT6+1/iGiZiHhzFrXYrX22g ZU+K6vMjasu7suCsTOacXCJakIGC2jX1MKSjil6Z9G+xBQnEKjyTdF/jtcpBrNHE//m/ uXO+ZLAII+8CxGdIZXY4NWBtPHRoOuhqh5YdBx09zkwDUxGoG9ANH1/unKM5EL8y6Sdu crhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582744; x=1723187544; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pQxehbjRCiGB0oMWs2FMmk72//7m3x//vhWw/Ey0KJ8=; b=kPhf4kDE8sKhs9p8Nu5OPiewYQqy/XwmVrMCwb39E+Wbx2Xiy6GMsDoMqf4lbiK8b1 cBjuZI6Peft+6ZE4LQCaW2NNLMKHe+vs9bYvUxYS0C7FQrikbWDRjCJPmUWO5w6o2SSq 7XPFUH5s9U0beSPyts9zBP6lZGIl0XdWmHAPtQL61jK2lJ5p4yofWWVtPilaPOjhZbuJ tXaXW+cOg3yYMvqDZV0+515xPBjcqk+DIUOEEamYQJ9sjLpsZBDkW6LicDUPkj0/lUia 1USskqH3nGsb70dfkZE2AANKmICnKj2P9OJeSPJdSCXIALCHe4XPoLHaA1CCB28656kx 1Vtw== X-Gm-Message-State: AOJu0YxcUWDuChVu+pz8NIBg+ZdzpW3HZn9O72wC5TPDDcknSzmupdus ZUsD+Du/u5yafGQZK69PPelKfXRpdilpFNv/aavIZXlJRVTz/5DVggvFuIoFCZPi70daQORHeJU iUg== X-Google-Smtp-Source: AGHT+IHtlUYBq8cHx3wtcAmCVsmiUgCraawCzogkxqnR0hjR557YwfSFnAN4nbqgIuwTkiqN1PDg4g== X-Received: by 2002:a05:6512:a87:b0:52e:be84:225c with SMTP id 2adb3069b0e04-530bb387b88mr1559293e87.33.1722582743861; Fri, 02 Aug 2024 00:12:23 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:23 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 03/26] ada: Fix layout of GNAT reference manual section Date: Fri, 2 Aug 2024 09:11:20 +0200 Message-ID: <20240802071210.413366-3-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Ronan Desplanques gcc/ada/ * doc/gnat_rm/gnat_language_extensions.rst: Fix layout of section. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/gnat_rm/gnat_language_extensions.rst | 5 +++-- gcc/ada/gnat_rm.texi | 5 +++-- gcc/ada/gnat_ugn.texi | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst b/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst index 0f001c4aca9..efda4afb742 100644 --- a/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst +++ b/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst @@ -53,8 +53,6 @@ A basic_declarative_item may appear at the place of any statement. This avoids the heavy syntax of block_statements just to declare something locally. -Link to the original RFC: -https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-local-vars-without-block.md For example: .. code-block:: ada @@ -67,6 +65,9 @@ For example: X := X + Squared; end if; +Link to the original RFC: +https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-local-vars-without-block.md + Conditional when constructs --------------------------- diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index b27bd627c17..d15d6204cd8 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -28850,8 +28850,6 @@ A basic_declarative_item may appear at the place of any statement. This avoids the heavy syntax of block_statements just to declare something locally. -Link to the original RFC: -@indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-local-vars-without-block.md} For example: @example @@ -28864,6 +28862,9 @@ if X > 5 then end if; @end example +Link to the original RFC: +@indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-local-vars-without-block.md} + @node Conditional when constructs,Fixed lower bounds for array types and subtypes,Local Declarations Without Block,Curated Extensions @anchor{gnat_rm/gnat_language_extensions conditional-when-constructs}@anchor{443} @subsection Conditional when constructs diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index ea1d2f9d71a..0e3ee935552 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -29670,8 +29670,8 @@ to permit their use in free software. @printindex ge -@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @anchor{d1}@w{ } +@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @c %**end of body @bye From patchwork Fri Aug 2 07:11:21 2024 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: 95158 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 542FC385E836 for ; Fri, 2 Aug 2024 07:13:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id 86833385DDFB for ; Fri, 2 Aug 2024 07:12:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 86833385DDFB Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 86833385DDFB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582751; cv=none; b=x7B9/SPL9cSoPDDWtxtRorfGMK1fczht8CYLSOq+68tV2Ovve9sM70MTuyFxKMUDIf9IiGDdPeb+4rd+YrQqis3jw1EYzpnJfGnzVGvLE+GA4SqdAt7WE1vUhmyCXl1cX10Rbg7q4FJ8QvcbmrBRYPkQowmzpUo91qUiy25DHas= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582751; c=relaxed/simple; bh=biVVIckT3dO7xZ9Ktsimw2nWlXjZ0XesofQtTMAQgqg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ULVp/TTDPUOFIr0h4p+MLKXXq9jlB8VVz2SJuLBPimqmxTX4EMO6ty/0/Dl+l/6N5FsS3mtLyJQ9waiD/Gev0FPE5neGnoHV5sS0O7sC+2JWDM8dLyKjJOZJ8sMwPIh91HAQebMaher+dCxWaVT4UGxoObs57KXxiN/5gQuEvSQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ef1c12ae23so89131741fa.0 for ; Fri, 02 Aug 2024 00:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582745; x=1723187545; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6WuzYJ9EG2yTnSexEauljDXaE6dYg2oVxEnZfMKP1c0=; b=TttBnxWp/kIcjy0SdeMaZsplTwVA+F/9FiboF1eeikRjxVBX1DJpIi0HissiJLlwVv 1Ongb+0/KkZncy662f0Ob3/LbLzLXKpYKaTWDTalDM+LXop2A6lVtgrYKXctLhqu+WlQ ZctgtbtbMmKTg0Yb+sP0DfvoCjLwt+4D0dwq/SZKhgd9e72+XbOlvRgalsPu4N5sRLTN 0lHafvmPgFn3DZSPDdXrJHlItZnnIPF+pn4kO4FnAgFQ4XDHCNtBIbIRUYPfJK/EeAuX 6mpWNo3mwK9YvmfdrIvjpguzNZ8VpjJECrYfFHPG9/7hJueZftis0M5hOG7vn97ORheE 8Mig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582745; x=1723187545; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6WuzYJ9EG2yTnSexEauljDXaE6dYg2oVxEnZfMKP1c0=; b=NFDTHHKgNgsxpgqPC7w/xkomLDdneftzBw5SPOt9dq/FIlp9jEcObogY0XeIz8yKE+ rgU8RSikTfzYrnA9hT0BRWbXSunQzRix9I0Z7VQQHq00lC+yqKS9s73xNZEgVrWugGTR rOHR8TvcMsOWNmi/LOAKZgaa0lQHq/0EkWkbD0EygN+XemG62nIRdenl09mnhP6lWbEa SrrKJ2Y0FU+m1QT40PbrSayITVFCdVGh/RVywBNt4J+jUjsmI8qy4eJCVnL/DtiWxE7U UvvbILbQlt+FelTmivPoZ20dCPjFTTVHUXxbACqBAAj1Dd0aTvAbL4cMJInargusXq+r vsQQ== X-Gm-Message-State: AOJu0YzF/W8LeY3aYBrWzbby5qa/8Z51dVcSlqEtCH5M2ThwXoNdjPp4 /cXdlnh9JfyEU+E9diSPHDWq2HUbNpnU3PeePjsJqVKIBQlV/UJ1xJubEGGyJ+81CvDraob4wca Mrg== X-Google-Smtp-Source: AGHT+IGD1lReVkpx7E0Dfakh0dVHxfiH9reP8hFYlrUXHPFBnV/3Bh1C16RPP1KjDztthABC2aqCkw== X-Received: by 2002:a2e:9084:0:b0:2f0:1a19:f3ec with SMTP id 38308e7fff4ca-2f15aaf63ffmr18280901fa.33.1722582744821; Fri, 02 Aug 2024 00:12:24 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:24 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Johannes Kliemann Subject: [COMMITTED 04/26] ada: Improve documenation about security of PRGNs Date: Fri, 2 Aug 2024 09:11:21 +0200 Message-ID: <20240802071210.413366-4-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Johannes Kliemann The pseudo random number generators used in GNAT are not suitable for applications that require cryptographic security. While this was mentioned in some places others did not have a corresponding note, leading to these generators being used in a non-suitable context. gcc/ada/ * doc/gnat_rm/standard_library_routines.rst: Add note to section of Ada.Numerics.Discrete_Random and Ada.Numerics.Float_Random. * doc/gnat_rm/the_gnat_library.rst: Add note to section about GNAT.Random_Numbers. * libgnat/a-nudira.ads: Add note about cryptographic properties. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/gnat_rm/standard_library_routines.rst | 6 ++++-- gcc/ada/doc/gnat_rm/the_gnat_library.rst | 4 +++- gcc/ada/gnat_rm.texi | 10 +++++++--- gcc/ada/gnat_ugn.texi | 2 +- gcc/ada/libgnat/a-nudira.ads | 2 ++ 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/gcc/ada/doc/gnat_rm/standard_library_routines.rst b/gcc/ada/doc/gnat_rm/standard_library_routines.rst index 27659a40463..2e7642652b2 100644 --- a/gcc/ada/doc/gnat_rm/standard_library_routines.rst +++ b/gcc/ada/doc/gnat_rm/standard_library_routines.rst @@ -302,12 +302,14 @@ the unit is not implemented. ``Ada.Numerics.Discrete_Random`` This generic package provides a random number generator suitable for generating - uniformly distributed values of a specified discrete subtype. + uniformly distributed values of a specified discrete subtype. It should not be + used as a cryptographic pseudo-random source. ``Ada.Numerics.Float_Random`` This package provides a random number generator suitable for generating - uniformly distributed floating point values in the unit interval. + uniformly distributed floating point values in the unit interval. It should not + be used as a cryptographic pseudo-random source. ``Ada.Numerics.Generic_Complex_Elementary_Functions`` diff --git a/gcc/ada/doc/gnat_rm/the_gnat_library.rst b/gcc/ada/doc/gnat_rm/the_gnat_library.rst index 88204d4cfe7..ac45b5eb7af 100644 --- a/gcc/ada/doc/gnat_rm/the_gnat_library.rst +++ b/gcc/ada/doc/gnat_rm/the_gnat_library.rst @@ -1329,7 +1329,9 @@ convenient for use with realtime applications. .. index:: Random number generation Provides random number capabilities which extend those available in the -standard Ada library and are more convenient to use. +standard Ada library and are more convenient to use. This package is +however NOT suitable for situations requiring cryptographically secure +randomness. .. _`GNAT.Regexp_(g-regexp.ads)`: diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index d15d6204cd8..d6e2f265ab9 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -21142,12 +21142,14 @@ build the type @code{Complex} and @code{Imaginary}. @item @code{Ada.Numerics.Discrete_Random} This generic package provides a random number generator suitable for generating -uniformly distributed values of a specified discrete subtype. +uniformly distributed values of a specified discrete subtype. It should not be +used as a cryptographic pseudo-random source. @item @code{Ada.Numerics.Float_Random} This package provides a random number generator suitable for generating -uniformly distributed floating point values in the unit interval. +uniformly distributed floating point values in the unit interval. It should not +be used as a cryptographic pseudo-random source. @item @code{Ada.Numerics.Generic_Complex_Elementary_Functions} @@ -24688,7 +24690,9 @@ convenient for use with realtime applications. @geindex Random number generation Provides random number capabilities which extend those available in the -standard Ada library and are more convenient to use. +standard Ada library and are more convenient to use. This package is +however NOT suitable for situations requiring cryptographically secure +randomness. @node GNAT Regexp g-regexp ads,GNAT Registry g-regist ads,GNAT Random_Numbers g-rannum ads,The GNAT Library @anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{270}@anchor{gnat_rm/the_gnat_library id90}@anchor{39b} diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 0e3ee935552..ea1d2f9d71a 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -29670,8 +29670,8 @@ to permit their use in free software. @printindex ge -@anchor{d1}@w{ } @anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } +@anchor{d1}@w{ } @c %**end of body @bye diff --git a/gcc/ada/libgnat/a-nudira.ads b/gcc/ada/libgnat/a-nudira.ads index 1b3eacb897d..c6d95731821 100644 --- a/gcc/ada/libgnat/a-nudira.ads +++ b/gcc/ada/libgnat/a-nudira.ads @@ -35,6 +35,8 @@ -- Note: the implementation used in this package is a version of the -- Mersenne Twister. See s-rannum.adb for details and references. +-- It is suitable for simulations, but should not be used as a cryptographic +-- pseudo-random source. with System.Random_Numbers; From patchwork Fri Aug 2 07:11:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 95172 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 0746B385F01D for ; Fri, 2 Aug 2024 07:18:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 056103858D26 for ; Fri, 2 Aug 2024 07:12:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 056103858D26 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 056103858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::435 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582762; cv=none; b=UfIZuMpEbOov5MJwNb9CDBcj+mrssvtTYCJv/mEEyE79tGi3TS78cR+enZc1ywshPAOId2hBggM/WEJCQzd1I9Q2fVS8kJfsIpoOr5OA4luMWtj902FQe+ggPoMK3iV5n85BwB4XOAT+3XMZYgyyVMGc/9aLsFCx2XTdGTkJCT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582762; c=relaxed/simple; bh=+sZpdEqlznxMfwxdYQ0Pa73VaJZeVGsrr03PG1AFY9I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=CGhOFVGEVUS/lQ3Klrma2F4r6VEk7GnYMYow2ydIjKo+/LocYY9L+GsH+4nNth0ePUXt2/Z0VNZALkQ4LM8wWBv/NaiWd4LNTiL8M2bM7PZBAp7WsNpAYuNEtuFvCvLcuW5A9brre9Hv6c+whRsV8Y5p6TZ09B38T2XeusPPc6o= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-368712acb8dso3657712f8f.2 for ; Fri, 02 Aug 2024 00:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582749; x=1723187549; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q+mSq76MDKR4fP8RawZsS/Wo8tYzGce/V5sI9yTINm8=; b=GeuT5KkdOWaWdujM7A0rY2tgm8Ext+GFdUrReqXKpa3gDtYPESPopjQepY/i6hg8No WYpkvbhXpvfEeHDnD+mVga3UgTPUbRtxINNJWmzi8Xt/MK9mzONFyKatqP6HlaFX7B6z htzU3FVBpG/cAzOs6Awu1jfUJ7Fc/kdxsL3ZoIzc0Rue6HWYxrvQLzYMTqsDqh96Vxia l9lZcGaXnuMH5nrdY/EVsWshrTZmsGDoGzv6e4H8p6RrqpVqnk5NryWLLbSLToOd+H7u rJVEW+VSiVW1rIt7CeqjJz/gdqziI9dhktAdh8XAXY50vA4Kpiz0/ypqjmsALMO+j+8K V1Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582749; x=1723187549; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q+mSq76MDKR4fP8RawZsS/Wo8tYzGce/V5sI9yTINm8=; b=QbJrKHc6BDsez79A9+BCzqk+PTt7pQL50Cd5847+ALAviT0+Fv+A/DQksj16u3xcOg WbxyEZ6d49AhS9DYftkAIfxzb/wHE9+D1c4hAcNr52gkHea1hvHiFbWT5JfLzjWUwDEs WRKkTAp8os7ItqiKRGyFY0MHwUDeMkXnoSVXKM1AUrYNSlYmGLCP78aqtSke2MYN7PnI C6JygFUKx/3fR5xSOppO65vpzmBTpBBgogrj4S25V/+30lidBihp5bvEc0AK3VlzOhJB sG3xw9Z4uEFcmn06wP3FIl76EJfUwuJ+01tGvWD3cVQ4iUBsGuOuq7q1+H5XOh+sLhSZ Iyjw== X-Gm-Message-State: AOJu0YwYwGxtrJvptzQYy9J4haY3P2zt6iBkQj5Qn6ceJSjtMzyZIwhG cKsdDSFMchFBFB6FPoFHd9yq40wPWE5ewijlO+2tXv+Y2W4ZnDvJRJhp8pFkwG74GMprHfWy+Yc quQ== X-Google-Smtp-Source: AGHT+IHEaP0dZxl8vmHkP6HpbzYg/DKMmgg9k7zDW9Kmg3g2CeJ4xn46Dr9gMd5Khuqd+gOm8C5fig== X-Received: by 2002:a5d:69ca:0:b0:368:35a7:b4f with SMTP id ffacd0b85a97d-36bbc0dcf6amr1283321f8f.16.1722582746662; Fri, 02 Aug 2024 00:12:26 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:25 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 05/26] ada: Implement No_Raise aspect & pragma on subprograms Date: Fri, 2 Aug 2024 09:11:22 +0200 Message-ID: <20240802071210.413366-5-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou The new aspect is automatically set on the Adjust and Finalize primitives of finalizable types, unless Relaxed_Finalization is explicitly set to False, but it can also be specified directly on subprograms. It is also available in earlier versions of the language by means of the associated pragma. gcc/ada/ * aspects.ads (Aspect_Id): Add Aspect_No_Raise identifier. (Implementation_Defined_Aspect): Add True for Aspect_No_Raise. (Is_Representation_Aspect): Add False for Aspect_No_Raise. (Aspect_Names): Add Name_No_Raise for Aspect_No_Raise. (Aspect_Delay): Add Always_Delay for Aspect_No_Raise. * checks.ads (Raise_Checks_Suppressed): New function. (Apply_Raise_Check): New procedure. * checks.adb (Apply_Raise_Check): New procedure. (Raise_Checks_Suppressed): New function. * doc/gnat_rm/gnat_language_extensions.rst (Generalized Finalization): Update. * doc/gnat_rm/implementation_defined_aspects.rst (No_Raise): New. * doc/gnat_rm/implementation_defined_characteristics.rst (Check names): Document Raise_Check and alphabetize others. * doc/gnat_rm/implementation_defined_pragmas.rst (No_Raise): New. * einfo.ads (No_Raise): New flag defined in subprograms and generic subprograms. * exp_ch6.adb (Expand_N_Subprogram_Body): Call Apply_Raise_Check at the end of the processing. * exp_ch11.adb (Get_RT_Exception_Name): Add alternative for PE_Raise_Check_Failed to case statement. * gen_il-fields.ads (Opt_Field_Enum): Add No_Raise identifier. * gen_il-gen-gen_entities.adb (Subprogram_Kind): Add No_Raise as semantical flag. (Generic_Subprogram_Kind): Likewise. * par-prag.adb (Prag): Add alternative for Pragma_No_Raise to case statement. * sem_ch13.adb (Validate_Finalizable_Aspect): Set No_Raise on the Adjust and Finalize primitives if Relaxed_Finalization is set. * sem_prag.adb (Analyze_Pragma): Add alternative for Pragma_No_Raise to case statement. (Sig_Flag): Add 0 for Pragma_No_Raise. * snames.ads-tmpl (Remaining pragma names): Add Name_No_Raise. (Names of recognized checks): Add Name_Raise_Check. (Pragma_Id): Add Pragma_No_Raise identifier. * types.ads (Raise_Check): New named number. (All_Checks): Adjust. (RT_Exception_Code): Add PE_Raise_Check_Failed identifier. (Rkind): Add PE_Reason for PE_Raise_Check_Failed and alphabetize. * types.h (RT_Exception_Code): Add PE_Raise_Check_Failed as 38. (LAST_REASON_CODE): Adjust. * libgnat/a-except.adb (Rcheck_PE_Raise_Check): New procedure with pragmas Export, No_Return and Machine_Attributes. (Rmsg_38): New string constant. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/aspects.ads | 5 + gcc/ada/checks.adb | 85 + gcc/ada/checks.ads | 5 + .../doc/gnat_rm/gnat_language_extensions.rst | 2 - .../implementation_defined_aspects.rst | 6 + ...implementation_defined_characteristics.rst | 9 +- .../implementation_defined_pragmas.rst | 19 + gcc/ada/einfo.ads | 6 + gcc/ada/exp_ch11.adb | 2 + gcc/ada/exp_ch6.adb | 8 +- gcc/ada/gen_il-fields.ads | 1 + gcc/ada/gen_il-gen-gen_entities.adb | 2 + gcc/ada/gnat_rm.texi | 1511 +++++++++-------- gcc/ada/libgnat/a-except.adb | 15 + gcc/ada/par-prag.adb | 1 + gcc/ada/sem_ch13.adb | 21 + gcc/ada/sem_prag.adb | 76 + gcc/ada/snames.ads-tmpl | 3 + gcc/ada/types.ads | 15 +- gcc/ada/types.h | 5 +- 20 files changed, 1039 insertions(+), 758 deletions(-) diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads index 3157e5cdd9a..9d0a9eb0110 100644 --- a/gcc/ada/aspects.ads +++ b/gcc/ada/aspects.ads @@ -210,6 +210,7 @@ package Aspects is Aspect_No_Caching, -- GNAT Aspect_No_Controlled_Parts, Aspect_No_Inline, -- GNAT + Aspect_No_Raise, -- GNAT Aspect_No_Return, Aspect_No_Tagged_Streams, -- GNAT Aspect_No_Task_Parts, -- GNAT @@ -309,6 +310,7 @@ package Aspects is Aspect_No_Caching => True, Aspect_No_Elaboration_Code_All => True, Aspect_No_Inline => True, + Aspect_No_Raise => True, Aspect_No_Tagged_Streams => True, Aspect_No_Task_Parts => True, Aspect_Obsolescent => True, @@ -629,6 +631,7 @@ package Aspects is Aspect_No_Caching => False, Aspect_No_Controlled_Parts => False, Aspect_No_Inline => False, + Aspect_No_Raise => False, Aspect_No_Return => False, Aspect_No_Tagged_Streams => False, Aspect_No_Task_Parts => False, @@ -741,6 +744,7 @@ package Aspects is Aspect_No_Task_Parts => Name_No_Task_Parts, Aspect_No_Elaboration_Code_All => Name_No_Elaboration_Code_All, Aspect_No_Inline => Name_No_Inline, + Aspect_No_Raise => Name_No_Raise, Aspect_No_Return => Name_No_Return, Aspect_No_Tagged_Streams => Name_No_Tagged_Streams, Aspect_Object_Size => Name_Object_Size, @@ -977,6 +981,7 @@ package Aspects is Aspect_Linker_Section => Always_Delay, Aspect_Lock_Free => Always_Delay, Aspect_No_Inline => Always_Delay, + Aspect_No_Raise => Always_Delay, Aspect_No_Return => Always_Delay, Aspect_Output => Always_Delay, Aspect_Persistent_BSS => Always_Delay, diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 504cba0b942..38fe687bc7a 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -2900,6 +2900,78 @@ package body Checks is (N, Make_Predicate_Check (Typ, Expr), Suppress => All_Checks); end Apply_Predicate_Check; + ----------------------- + -- Apply_Raise_Check -- + ----------------------- + + procedure Apply_Raise_Check (N : Node_Id) is + Loc : constant Source_Ptr := Sloc (N); + + Block : Node_Id; + Block_Id : Entity_Id; + HSS : Node_Id; + Spec_Id : Entity_Id; + + begin + pragma Assert (Nkind (N) = N_Subprogram_Body); + + if Present (Corresponding_Spec (N)) then + Spec_Id := Corresponding_Spec (N); + else + Spec_Id := Defining_Entity (N); + end if; + + -- Return immediately if the check is not needed or is suppressed + + if not No_Raise (Spec_Id) or else Raise_Checks_Suppressed (Spec_Id) then + return; + end if; + + -- Build a block using the declarations, statements and At_End procedure + -- from the subprogram body. + + Block_Id := New_Internal_Entity (E_Block, Spec_Id, Loc, 'B'); + Set_Etype (Block_Id, Standard_Void_Type); + Set_Scope (Block_Id, Spec_Id); + + Block := + Make_Block_Statement (Loc, + Identifier => New_Occurrence_Of (Block_Id, Loc), + Declarations => Declarations (N), + Handled_Statement_Sequence => Handled_Statement_Sequence (N), + At_End_Proc => At_End_Proc (N)); + + Set_Parent (Block_Id, Block); + + -- Wrap the block in a sequence of statements with an Others handler + -- and attach it directly to the subprogram body. Generate: + -- + -- begin + -- Bnn : + -- ... + -- end Bnn; + -- exception + -- when others => + -- [program_error "raise check failed"] + -- end + + HSS := + Make_Handled_Sequence_Of_Statements (Loc, + Statements => New_List (Block), + Exception_Handlers => New_List ( + Make_Exception_Handler (Loc, + Exception_Choices => New_List (Make_Others_Choice (Loc)), + Statements => New_List ( + Make_Raise_Program_Error (Loc, + Reason => PE_Raise_Check_Failed))))); + + Set_Declarations (N, No_List); + Set_Handled_Statement_Sequence (N, HSS); + Set_At_End_Proc (N, Empty); + + Analyze (HSS); + end Apply_Raise_Check; + ----------------------- -- Apply_Range_Check -- ----------------------- @@ -9572,6 +9644,19 @@ package body Checks is end if; end Predicate_Checks_Suppressed; + ----------------------------- + -- Raise_Checks_Suppressed -- + ----------------------------- + + function Raise_Checks_Suppressed (E : Entity_Id) return Boolean is + begin + if Present (E) and then Checks_May_Be_Suppressed (E) then + return Is_Check_Suppressed (E, Raise_Check); + else + return Scope_Suppress.Suppress (Raise_Check); + end if; + end Raise_Checks_Suppressed; + ----------------------------- -- Range_Checks_Suppressed -- ----------------------------- diff --git a/gcc/ada/checks.ads b/gcc/ada/checks.ads index 010627c3b03..322629a3c1f 100644 --- a/gcc/ada/checks.ads +++ b/gcc/ada/checks.ads @@ -69,6 +69,7 @@ package Checks is function Length_Checks_Suppressed (E : Entity_Id) return Boolean; function Overflow_Checks_Suppressed (E : Entity_Id) return Boolean; function Predicate_Checks_Suppressed (E : Entity_Id) return Boolean; + function Raise_Checks_Suppressed (E : Entity_Id) return Boolean; function Range_Checks_Suppressed (E : Entity_Id) return Boolean; function Storage_Checks_Suppressed (E : Entity_Id) return Boolean; function Tag_Checks_Suppressed (E : Entity_Id) return Boolean; @@ -265,6 +266,10 @@ package Checks is -- When N is an actual in a call, Fun is the function being called, which -- is used to generate a warning if the call leads to infinite recursion. + procedure Apply_Raise_Check (N : Node_Id); + -- N is an N_Subprogram_Body node. Apply a raise check to N if its entity + -- is subject to the GNAT aspect/pragma No_Raise. + procedure Apply_Type_Conversion_Checks (N : Node_Id); -- N is an N_Type_Conversion node. A type conversion actually involves -- two sorts of checks. The first check is the checks that ensures that diff --git a/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst b/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst index efda4afb742..32f00c0c7a5 100644 --- a/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst +++ b/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst @@ -579,7 +579,5 @@ Example: procedure Finalize (Obj : in out Ctrl); procedure Initialize (Obj : in out Ctrl); -As of this writing, the RFC is implemented except for the `No_Raise` aspect. - Link to the original RFC: https://github.com/AdaCore/ada-spark-rfcs/blob/topic/finalization-rehaul/considered/rfc-generalized-finalization.md diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst b/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst index e19684c31b9..87180235832 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst @@ -473,6 +473,12 @@ Aspect No_Inline This boolean aspect is equivalent to :ref:`pragma No_Inline`. +Aspect No_Raise +=============== +.. index:: No_Raise + +This boolean aspect is equivalent to :ref:`pragma No_Raise`. + Aspect No_Tagged_Streams ======================== .. index:: No_Tagged_Streams diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst b/gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst index 54bcd0c1732..5399bda55e8 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst @@ -479,10 +479,11 @@ via compiler switches such as "-gnata". "Implementation-defined check names. See 11.5(27)." The implementation defined check names include Alignment_Check, -Atomic_Synchronization, Duplicated_Tag_Check, Container_Checks, -Tampering_Check, Predicate_Check, and Validity_Check. In addition, a user -program can add implementation-defined check names by means of the pragma -Check_Name. See the description of pragma ``Suppress`` for full details. +Atomic_Synchronization, Container_Checks, Duplicated_Tag_Check, +Predicate_Check, Raise_Check, Tampering_Check, and Validity_Check. +In addition, a user program can add implementation-defined check +names by means of the pragma Check_Name. See the description of +pragma ``Suppress`` for full details. * "Existence and meaning of second parameter of pragma Unsuppress. diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst index f31a1b9a7b8..926c5f4e37b 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst @@ -3923,6 +3923,25 @@ in particular it is not subject to the use of option *-gnatn* or *-gnatN*. It is illegal to specify both pragma ``No_Inline`` and pragma ``Inline_Always`` for the same ``NAME``. +.. _Pragma-No_Raise: + +Pragma No_Raise +=============== + +Syntax: + + +:: + + pragma No_Raise (subprogram_LOCAL_NAME {, subprogram_LOCAL_NAME}); + + +Each ``subprogram_LOCAL_NAME`` argument must refer to one or more subprogram +declarations in the current declarative part. A subprogram to which this +pragma is applied may not raise an exception that is not caught within it. +An implementation-defined check named `Raise_Check` is associated with the +pragma, and `Program_Error` is raised upon its failure (see RM 11.5(19/5)). + Pragma No_Return ================ diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 95f524e6c21..9d0f2ee3c02 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -3794,6 +3794,10 @@ package Einfo is -- in the spec of a generic package, in constructs that forbid discrete -- types with predicates. +-- No_Raise +-- Defined in subprograms and generic subprograms. Set if a valid aspect +-- or pragma No_Raise applies. + -- No_Reordering [implementation base type only] -- Defined in record types. Set only for a base type to which a valid -- pragma No_Component_Reordering applies. @@ -5578,6 +5582,7 @@ package Einfo is -- Is_Visible_Lib_Unit -- Is_Wrapper -- Needs_No_Actuals + -- No_Raise -- No_Return -- Requires_Overriding (non-generic case only) -- Return_Present @@ -5939,6 +5944,7 @@ package Einfo is -- Is_Valued_Procedure -- Is_Visible_Lib_Unit -- Needs_No_Actuals + -- No_Raise -- No_Return -- Requires_Overriding (non-generic case only) -- Sec_Stack_Needed_For_Return diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb index 925b164cb2f..eda9f17fa7d 100644 --- a/gcc/ada/exp_ch11.adb +++ b/gcc/ada/exp_ch11.adb @@ -1983,6 +1983,8 @@ package body Exp_Ch11 is Add_Str_To_Name_Buffer ("PE_Overlaid_Controlled_Object"); when PE_Potentially_Blocking_Operation => Add_Str_To_Name_Buffer ("PE_Potentially_Blocking_Operation"); + when PE_Raise_Check_Failed => + Add_Str_To_Name_Buffer ("PE_Raise_Check"); when PE_Stream_Operation_Not_Allowed => Add_Str_To_Name_Buffer ("PE_Stream_Operation_Not_Allowed"); when PE_Stubbed_Subprogram_Called => diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 9c182b2c6b4..24b754731d2 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -5689,8 +5689,6 @@ package body Exp_Ch6 is -- (this makes things easier on Gigi which does not want to have to handle -- a missing return). - -- Add call to Activate_Tasks if body is a task activator - -- Deal with possible detection of infinite recursion -- Eliminate body completely if convention stubbed @@ -5704,7 +5702,7 @@ package body Exp_Ch6 is -- or has any parameters of limited types, where limited means that the -- run-time view is limited (i.e. the full type is limited). - -- Wrap thread body + -- Apply raise check procedure Expand_N_Subprogram_Body (N : Node_Id) is Body_Id : constant Entity_Id := Defining_Entity (N); @@ -6033,6 +6031,10 @@ package body Exp_Ch6 is -- without it being previously elaborated. Install_Primitive_Elaboration_Check (N); + + -- If the subprogram is subject to pragma No_Raise, apply the check + + Apply_Raise_Check (N); end Expand_N_Subprogram_Body; ----------------------------------- diff --git a/gcc/ada/gen_il-fields.ads b/gcc/ada/gen_il-fields.ads index a3e85ac6531..520ea554e11 100644 --- a/gcc/ada/gen_il-fields.ads +++ b/gcc/ada/gen_il-fields.ads @@ -825,6 +825,7 @@ package Gen_IL.Fields is No_Dynamic_Predicate_On_Actual, No_Pool_Assigned, No_Predicate_On_Actual, + No_Raise, No_Reordering, No_Return, No_Strict_Aliasing, diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb index 2e0d51f6592..86701cf9e31 100644 --- a/gcc/ada/gen_il-gen-gen_entities.adb +++ b/gcc/ada/gen_il-gen-gen_entities.adb @@ -984,6 +984,7 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Linker_Section_Pragma, Node_Id), Sm (Overridden_Operation, Node_Id), Sm (Protected_Body_Subprogram, Node_Id), + Sm (No_Raise, Flag), Sm (No_Return, Flag), Sm (Scope_Depth_Value, Unat), Sm (Static_Call_Helper, Node_Id), @@ -1193,6 +1194,7 @@ begin -- Gen_IL.Gen.Gen_Entities (Sm (Has_Out_Or_In_Out_Parameter, Flag), Sm (Is_Primitive, Flag), Sm (Next_Inlined_Subprogram, Node_Id), + Sm (No_Raise, Flag), Sm (No_Return, Flag), Sm (Overridden_Operation, Node_Id))); diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index d6e2f265ab9..d5e8931e088 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -210,6 +210,7 @@ Implementation Defined Pragmas * Pragma No_Elaboration_Code_All:: * Pragma No_Heap_Finalization:: * Pragma No_Inline:: +* Pragma No_Raise:: * Pragma No_Return:: * Pragma No_Strict_Aliasing:: * Pragma No_Tagged_Streams:: @@ -337,6 +338,7 @@ Implementation Defined Aspects * Aspect No_Caching:: * Aspect No_Elaboration_Code_All:: * Aspect No_Inline:: +* Aspect No_Raise:: * Aspect No_Tagged_Streams:: * Aspect No_Task_Parts:: * Aspect Object_Size:: @@ -1335,6 +1337,7 @@ consideration, the use of these pragmas should be minimized. * Pragma No_Elaboration_Code_All:: * Pragma No_Heap_Finalization:: * Pragma No_Inline:: +* Pragma No_Raise:: * Pragma No_Return:: * Pragma No_Strict_Aliasing:: * Pragma No_Tagged_Streams:: @@ -5449,7 +5452,7 @@ A library-level named access-to-object type declared within a generic unit will lose its @code{No_Heap_Finalization} pragma when the corresponding instance does not appear at the library level. -@node Pragma No_Inline,Pragma No_Return,Pragma No_Heap_Finalization,Implementation Defined Pragmas +@node Pragma No_Inline,Pragma No_Raise,Pragma No_Heap_Finalization,Implementation Defined Pragmas @anchor{gnat_rm/implementation_defined_pragmas id27}@anchor{ab}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-inline}@anchor{ac} @section Pragma No_Inline @@ -5467,8 +5470,25 @@ in particular it is not subject to the use of option `-gnatn' or `-gnatN'. It is illegal to specify both pragma @code{No_Inline} and pragma @code{Inline_Always} for the same @code{NAME}. -@node Pragma No_Return,Pragma No_Strict_Aliasing,Pragma No_Inline,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-return}@anchor{ad} +@node Pragma No_Raise,Pragma No_Return,Pragma No_Inline,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas id28}@anchor{ad}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-raise}@anchor{ae} +@section Pragma No_Raise + + +Syntax: + +@example +pragma No_Raise (subprogram_LOCAL_NAME @{, subprogram_LOCAL_NAME@}); +@end example + +Each @code{subprogram_LOCAL_NAME} argument must refer to one or more subprogram +declarations in the current declarative part. A subprogram to which this +pragma is applied may not raise an exception that is not caught within it. +An implementation-defined check named @cite{Raise_Check} is associated with the +pragma, and @cite{Program_Error} is raised upon its failure (see RM 11.5(19/5)). + +@node Pragma No_Return,Pragma No_Strict_Aliasing,Pragma No_Raise,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-return}@anchor{af} @section Pragma No_Return @@ -5495,7 +5515,7 @@ available in all earlier versions of Ada as an implementation-defined pragma. @node Pragma No_Strict_Aliasing,Pragma No_Tagged_Streams,Pragma No_Return,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-strict-aliasing}@anchor{ae} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-strict-aliasing}@anchor{b0} @section Pragma No_Strict_Aliasing @@ -5517,7 +5537,7 @@ in the @cite{GNAT User’s Guide}. This pragma currently has no effects on access to unconstrained array types. @node Pragma No_Tagged_Streams,Pragma Normalize_Scalars,Pragma No_Strict_Aliasing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id28}@anchor{af}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-tagged-streams}@anchor{b0} +@anchor{gnat_rm/implementation_defined_pragmas id29}@anchor{b1}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-tagged-streams}@anchor{b2} @section Pragma No_Tagged_Streams @@ -5556,7 +5576,7 @@ with empty strings. This is useful to avoid exposing entity names at binary level but has a negative impact on the debuggability of tagged types. @node Pragma Normalize_Scalars,Pragma Obsolescent,Pragma No_Tagged_Streams,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-normalize-scalars}@anchor{b1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-normalize-scalars}@anchor{b3} @section Pragma Normalize_Scalars @@ -5638,7 +5658,7 @@ will always generate an invalid value if one exists. @end table @node Pragma Obsolescent,Pragma Optimize_Alignment,Pragma Normalize_Scalars,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id29}@anchor{b2}@anchor{gnat_rm/implementation_defined_pragmas pragma-obsolescent}@anchor{b3} +@anchor{gnat_rm/implementation_defined_pragmas id30}@anchor{b4}@anchor{gnat_rm/implementation_defined_pragmas pragma-obsolescent}@anchor{b5} @section Pragma Obsolescent @@ -5734,7 +5754,7 @@ So if you specify @code{Entity =>} for the @code{Entity} argument, and a @code{M argument is present, it must be preceded by @code{Message =>}. @node Pragma Optimize_Alignment,Pragma Ordered,Pragma Obsolescent,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-optimize-alignment}@anchor{b4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-optimize-alignment}@anchor{b6} @section Pragma Optimize_Alignment @@ -5820,7 +5840,7 @@ latter are compiled by default in pragma Optimize_Alignment (Off) mode if no pragma appears at the start of the file. @node Pragma Ordered,Pragma Overflow_Mode,Pragma Optimize_Alignment,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ordered}@anchor{b5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ordered}@anchor{b7} @section Pragma Ordered @@ -5912,7 +5932,7 @@ For additional information please refer to the description of the `-gnatw.u' switch in the GNAT User’s Guide. @node Pragma Overflow_Mode,Pragma Overriding_Renamings,Pragma Ordered,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-overflow-mode}@anchor{b6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-overflow-mode}@anchor{b8} @section Pragma Overflow_Mode @@ -5951,7 +5971,7 @@ The pragma @code{Unsuppress (Overflow_Check)} unsuppresses (enables) overflow checking, but does not affect the overflow mode. @node Pragma Overriding_Renamings,Pragma Part_Of,Pragma Overflow_Mode,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-overriding-renamings}@anchor{b7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-overriding-renamings}@anchor{b9} @section Pragma Overriding_Renamings @@ -5986,7 +6006,7 @@ RM 8.3 (15) stipulates that an overridden operation is not visible within the declaration of the overriding operation. @node Pragma Part_Of,Pragma Partition_Elaboration_Policy,Pragma Overriding_Renamings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id30}@anchor{b8}@anchor{gnat_rm/implementation_defined_pragmas pragma-part-of}@anchor{b9} +@anchor{gnat_rm/implementation_defined_pragmas id31}@anchor{ba}@anchor{gnat_rm/implementation_defined_pragmas pragma-part-of}@anchor{bb} @section Pragma Part_Of @@ -6002,7 +6022,7 @@ For the semantics of this pragma, see the entry for aspect @code{Part_Of} in the SPARK 2014 Reference Manual, section 7.2.6. @node Pragma Partition_Elaboration_Policy,Pragma Passive,Pragma Part_Of,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-partition-elaboration-policy}@anchor{ba} +@anchor{gnat_rm/implementation_defined_pragmas pragma-partition-elaboration-policy}@anchor{bc} @section Pragma Partition_Elaboration_Policy @@ -6019,7 +6039,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Passive,Pragma Persistent_BSS,Pragma Partition_Elaboration_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-passive}@anchor{bb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-passive}@anchor{bd} @section Pragma Passive @@ -6043,7 +6063,7 @@ For more information on the subject of passive tasks, see the section ‘Passive Task Optimization’ in the GNAT Users Guide. @node Pragma Persistent_BSS,Pragma Post,Pragma Passive,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id31}@anchor{bc}@anchor{gnat_rm/implementation_defined_pragmas pragma-persistent-bss}@anchor{bd} +@anchor{gnat_rm/implementation_defined_pragmas id32}@anchor{be}@anchor{gnat_rm/implementation_defined_pragmas pragma-persistent-bss}@anchor{bf} @section Pragma Persistent_BSS @@ -6074,7 +6094,7 @@ If this pragma is used on a target where this feature is not supported, then the pragma will be ignored. See also @code{pragma Linker_Section}. @node Pragma Post,Pragma Postcondition,Pragma Persistent_BSS,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-post}@anchor{be} +@anchor{gnat_rm/implementation_defined_pragmas pragma-post}@anchor{c0} @section Pragma Post @@ -6099,7 +6119,7 @@ appear at the start of the declarations in a subprogram body (preceded only by other pragmas). @node Pragma Postcondition,Pragma Post_Class,Pragma Post,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-postcondition}@anchor{bf} +@anchor{gnat_rm/implementation_defined_pragmas pragma-postcondition}@anchor{c1} @section Pragma Postcondition @@ -6264,7 +6284,7 @@ Ada 2012, and has been retained in its original form for compatibility purposes. @node Pragma Post_Class,Pragma Pre,Pragma Postcondition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-post-class}@anchor{c0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-post-class}@anchor{c2} @section Pragma Post_Class @@ -6299,7 +6319,7 @@ policy that controls this pragma is @code{Post'Class}, not @code{Post_Class}. @node Pragma Pre,Pragma Precondition,Pragma Post_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-pre}@anchor{c1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pre}@anchor{c3} @section Pragma Pre @@ -6324,7 +6344,7 @@ appear at the start of the declarations in a subprogram body (preceded only by other pragmas). @node Pragma Precondition,Pragma Predicate,Pragma Pre,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-precondition}@anchor{c2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-precondition}@anchor{c4} @section Pragma Precondition @@ -6383,7 +6403,7 @@ Ada 2012, and has been retained in its original form for compatibility purposes. @node Pragma Predicate,Pragma Predicate_Failure,Pragma Precondition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id32}@anchor{c3}@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate}@anchor{c4} +@anchor{gnat_rm/implementation_defined_pragmas id33}@anchor{c5}@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate}@anchor{c6} @section Pragma Predicate @@ -6437,7 +6457,7 @@ defined for subtype B). When following this approach, the use of predicates should be avoided. @node Pragma Predicate_Failure,Pragma Preelaborable_Initialization,Pragma Predicate,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate-failure}@anchor{c5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate-failure}@anchor{c7} @section Pragma Predicate_Failure @@ -6454,7 +6474,7 @@ the language-defined @code{Predicate_Failure} aspect, and shares its restrictions and semantics. @node Pragma Preelaborable_Initialization,Pragma Prefix_Exception_Messages,Pragma Predicate_Failure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-preelaborable-initialization}@anchor{c6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-preelaborable-initialization}@anchor{c8} @section Pragma Preelaborable_Initialization @@ -6469,7 +6489,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Prefix_Exception_Messages,Pragma Pre_Class,Pragma Preelaborable_Initialization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-prefix-exception-messages}@anchor{c7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-prefix-exception-messages}@anchor{c9} @section Pragma Prefix_Exception_Messages @@ -6500,7 +6520,7 @@ prefixing in this case, you can always call @code{GNAT.Source_Info.Enclosing_Entity} and prepend the string manually. @node Pragma Pre_Class,Pragma Priority_Specific_Dispatching,Pragma Prefix_Exception_Messages,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-pre-class}@anchor{c8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pre-class}@anchor{ca} @section Pragma Pre_Class @@ -6535,7 +6555,7 @@ policy that controls this pragma is @code{Pre'Class}, not @code{Pre_Class}. @node Pragma Priority_Specific_Dispatching,Pragma Profile,Pragma Pre_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-priority-specific-dispatching}@anchor{c9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-priority-specific-dispatching}@anchor{cb} @section Pragma Priority_Specific_Dispatching @@ -6559,7 +6579,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Profile,Pragma Profile_Warnings,Pragma Priority_Specific_Dispatching,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-profile}@anchor{ca} +@anchor{gnat_rm/implementation_defined_pragmas pragma-profile}@anchor{cc} @section Pragma Profile @@ -6838,7 +6858,7 @@ conforming Ada constructs. The profile enables the following three pragmas: @end itemize @node Pragma Profile_Warnings,Pragma Propagate_Exceptions,Pragma Profile,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-profile-warnings}@anchor{cb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-profile-warnings}@anchor{cd} @section Pragma Profile_Warnings @@ -6856,7 +6876,7 @@ violations of the profile generate warning messages instead of error messages. @node Pragma Propagate_Exceptions,Pragma Provide_Shift_Operators,Pragma Profile_Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-propagate-exceptions}@anchor{cc} +@anchor{gnat_rm/implementation_defined_pragmas pragma-propagate-exceptions}@anchor{ce} @section Pragma Propagate_Exceptions @@ -6875,7 +6895,7 @@ purposes. It used to be used in connection with optimization of a now-obsolete mechanism for implementation of exceptions. @node Pragma Provide_Shift_Operators,Pragma Psect_Object,Pragma Propagate_Exceptions,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-provide-shift-operators}@anchor{cd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-provide-shift-operators}@anchor{cf} @section Pragma Provide_Shift_Operators @@ -6895,7 +6915,7 @@ including the function declarations for these five operators, together with the pragma Import (Intrinsic, …) statements. @node Pragma Psect_Object,Pragma Pure_Function,Pragma Provide_Shift_Operators,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-psect-object}@anchor{ce} +@anchor{gnat_rm/implementation_defined_pragmas pragma-psect-object}@anchor{d0} @section Pragma Psect_Object @@ -6915,7 +6935,7 @@ EXTERNAL_SYMBOL ::= This pragma is identical in effect to pragma @code{Common_Object}. @node Pragma Pure_Function,Pragma Rational,Pragma Psect_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id33}@anchor{cf}@anchor{gnat_rm/implementation_defined_pragmas pragma-pure-function}@anchor{d0} +@anchor{gnat_rm/implementation_defined_pragmas id34}@anchor{d1}@anchor{gnat_rm/implementation_defined_pragmas pragma-pure-function}@anchor{d2} @section Pragma Pure_Function @@ -6977,7 +6997,7 @@ unit is not a Pure unit in the categorization sense. So for example, a function thus marked is free to @code{with} non-pure units. @node Pragma Rational,Pragma Ravenscar,Pragma Pure_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-rational}@anchor{d1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-rational}@anchor{d3} @section Pragma Rational @@ -6995,7 +7015,7 @@ pragma Profile (Rational); @end example @node Pragma Ravenscar,Pragma Refined_Depends,Pragma Rational,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ravenscar}@anchor{d2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ravenscar}@anchor{d4} @section Pragma Ravenscar @@ -7015,7 +7035,7 @@ pragma Profile (Ravenscar); which is the preferred method of setting the @code{Ravenscar} profile. @node Pragma Refined_Depends,Pragma Refined_Global,Pragma Ravenscar,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id34}@anchor{d3}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-depends}@anchor{d4} +@anchor{gnat_rm/implementation_defined_pragmas id35}@anchor{d5}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-depends}@anchor{d6} @section Pragma Refined_Depends @@ -7048,7 +7068,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_Depends the SPARK 2014 Reference Manual, section 6.1.5. @node Pragma Refined_Global,Pragma Refined_Post,Pragma Refined_Depends,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id35}@anchor{d5}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-global}@anchor{d6} +@anchor{gnat_rm/implementation_defined_pragmas id36}@anchor{d7}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-global}@anchor{d8} @section Pragma Refined_Global @@ -7073,7 +7093,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_Global} the SPARK 2014 Reference Manual, section 6.1.4. @node Pragma Refined_Post,Pragma Refined_State,Pragma Refined_Global,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id36}@anchor{d7}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-post}@anchor{d8} +@anchor{gnat_rm/implementation_defined_pragmas id37}@anchor{d9}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-post}@anchor{da} @section Pragma Refined_Post @@ -7087,7 +7107,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_Post} i the SPARK 2014 Reference Manual, section 7.2.7. @node Pragma Refined_State,Pragma Relative_Deadline,Pragma Refined_Post,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id37}@anchor{d9}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-state}@anchor{da} +@anchor{gnat_rm/implementation_defined_pragmas id38}@anchor{db}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-state}@anchor{dc} @section Pragma Refined_State @@ -7113,7 +7133,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_State} the SPARK 2014 Reference Manual, section 7.2.2. @node Pragma Relative_Deadline,Pragma Remote_Access_Type,Pragma Refined_State,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-relative-deadline}@anchor{db} +@anchor{gnat_rm/implementation_defined_pragmas pragma-relative-deadline}@anchor{dd} @section Pragma Relative_Deadline @@ -7128,7 +7148,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Remote_Access_Type,Pragma Rename_Pragma,Pragma Relative_Deadline,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id38}@anchor{dc}@anchor{gnat_rm/implementation_defined_pragmas pragma-remote-access-type}@anchor{dd} +@anchor{gnat_rm/implementation_defined_pragmas id39}@anchor{de}@anchor{gnat_rm/implementation_defined_pragmas pragma-remote-access-type}@anchor{df} @section Pragma Remote_Access_Type @@ -7154,7 +7174,7 @@ pertaining to remote access to class-wide types. At instantiation, the actual type must be a remote access to class-wide type. @node Pragma Rename_Pragma,Pragma Restricted_Run_Time,Pragma Remote_Access_Type,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-rename-pragma}@anchor{de} +@anchor{gnat_rm/implementation_defined_pragmas pragma-rename-pragma}@anchor{e0} @section Pragma Rename_Pragma @@ -7193,7 +7213,7 @@ Pragma Inline_Only will not necessarily mean the same thing as the other Ada compiler; it’s up to you to make sure the semantics are close enough. @node Pragma Restricted_Run_Time,Pragma Restriction_Warnings,Pragma Rename_Pragma,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-restricted-run-time}@anchor{df} +@anchor{gnat_rm/implementation_defined_pragmas pragma-restricted-run-time}@anchor{e1} @section Pragma Restricted_Run_Time @@ -7214,7 +7234,7 @@ which is the preferred method of setting the restricted run time profile. @node Pragma Restriction_Warnings,Pragma Reviewable,Pragma Restricted_Run_Time,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-restriction-warnings}@anchor{e0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-restriction-warnings}@anchor{e2} @section Pragma Restriction_Warnings @@ -7252,7 +7272,7 @@ generating a warning, but any other use of implementation defined pragmas will cause a warning to be generated. @node Pragma Reviewable,Pragma Secondary_Stack_Size,Pragma Restriction_Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-reviewable}@anchor{e1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-reviewable}@anchor{e3} @section Pragma Reviewable @@ -7356,7 +7376,7 @@ comprehensive messages identifying possible problems based on this information. @node Pragma Secondary_Stack_Size,Pragma Share_Generic,Pragma Reviewable,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id39}@anchor{e2}@anchor{gnat_rm/implementation_defined_pragmas pragma-secondary-stack-size}@anchor{e3} +@anchor{gnat_rm/implementation_defined_pragmas id40}@anchor{e4}@anchor{gnat_rm/implementation_defined_pragmas pragma-secondary-stack-size}@anchor{e5} @section Pragma Secondary_Stack_Size @@ -7392,7 +7412,7 @@ Note the pragma cannot appear when the restriction @code{No_Secondary_Stack} is in effect. @node Pragma Share_Generic,Pragma Shared,Pragma Secondary_Stack_Size,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-share-generic}@anchor{e4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-share-generic}@anchor{e6} @section Pragma Share_Generic @@ -7410,7 +7430,7 @@ than to check that the given names are all names of generic units or generic instances. @node Pragma Shared,Pragma Short_Circuit_And_Or,Pragma Share_Generic,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id40}@anchor{e5}@anchor{gnat_rm/implementation_defined_pragmas pragma-shared}@anchor{e6} +@anchor{gnat_rm/implementation_defined_pragmas id41}@anchor{e7}@anchor{gnat_rm/implementation_defined_pragmas pragma-shared}@anchor{e8} @section Pragma Shared @@ -7418,7 +7438,7 @@ This pragma is provided for compatibility with Ada 83. The syntax and semantics are identical to pragma Atomic. @node Pragma Short_Circuit_And_Or,Pragma Short_Descriptors,Pragma Shared,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-short-circuit-and-or}@anchor{e7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-short-circuit-and-or}@anchor{e9} @section Pragma Short_Circuit_And_Or @@ -7437,7 +7457,7 @@ within the file being compiled, it applies only to the file being compiled. There is no requirement that all units in a partition use this option. @node Pragma Short_Descriptors,Pragma Side_Effects,Pragma Short_Circuit_And_Or,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-short-descriptors}@anchor{e8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-short-descriptors}@anchor{ea} @section Pragma Short_Descriptors @@ -7451,7 +7471,7 @@ This pragma is provided for compatibility with other Ada implementations. It is recognized but ignored by all current versions of GNAT. @node Pragma Side_Effects,Pragma Simple_Storage_Pool_Type,Pragma Short_Descriptors,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id41}@anchor{e9}@anchor{gnat_rm/implementation_defined_pragmas pragma-side-effects}@anchor{ea} +@anchor{gnat_rm/implementation_defined_pragmas id42}@anchor{eb}@anchor{gnat_rm/implementation_defined_pragmas pragma-side-effects}@anchor{ec} @section Pragma Side_Effects @@ -7465,7 +7485,7 @@ For the semantics of this pragma, see the entry for aspect @code{Side_Effects} in the SPARK Reference Manual, section 6.1.11. @node Pragma Simple_Storage_Pool_Type,Pragma Source_File_Name,Pragma Side_Effects,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id42}@anchor{eb}@anchor{gnat_rm/implementation_defined_pragmas pragma-simple-storage-pool-type}@anchor{ec} +@anchor{gnat_rm/implementation_defined_pragmas id43}@anchor{ed}@anchor{gnat_rm/implementation_defined_pragmas pragma-simple-storage-pool-type}@anchor{ee} @section Pragma Simple_Storage_Pool_Type @@ -7519,7 +7539,7 @@ storage-management discipline). An object of a simple storage pool type can be associated with an access type by specifying the attribute -@ref{ed,,Simple_Storage_Pool}. For example: +@ref{ef,,Simple_Storage_Pool}. For example: @example My_Pool : My_Simple_Storage_Pool_Type; @@ -7529,11 +7549,11 @@ type Acc is access My_Data_Type; for Acc'Simple_Storage_Pool use My_Pool; @end example -See attribute @ref{ed,,Simple_Storage_Pool} +See attribute @ref{ef,,Simple_Storage_Pool} for further details. @node Pragma Source_File_Name,Pragma Source_File_Name_Project,Pragma Simple_Storage_Pool_Type,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id43}@anchor{ee}@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name}@anchor{ef} +@anchor{gnat_rm/implementation_defined_pragmas id44}@anchor{f0}@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name}@anchor{f1} @section Pragma Source_File_Name @@ -7625,20 +7645,20 @@ aware of these pragmas, and so other tools that use the project file would not be aware of the intended naming conventions. If you are using project files, file naming is controlled by Source_File_Name_Project pragmas, which are usually supplied automatically by the project manager. A pragma -Source_File_Name cannot appear after a @ref{f0,,Pragma Source_File_Name_Project}. +Source_File_Name cannot appear after a @ref{f2,,Pragma Source_File_Name_Project}. For more details on the use of the @code{Source_File_Name} pragma, see the sections on @cite{Using Other File Names} and @cite{Alternative File Naming Schemes} in the @cite{GNAT User’s Guide}. @node Pragma Source_File_Name_Project,Pragma Source_Reference,Pragma Source_File_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id44}@anchor{f1}@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name-project}@anchor{f0} +@anchor{gnat_rm/implementation_defined_pragmas id45}@anchor{f3}@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name-project}@anchor{f2} @section Pragma Source_File_Name_Project This pragma has the same syntax and semantics as pragma Source_File_Name. It is only allowed as a stand-alone configuration pragma. -It cannot appear after a @ref{ef,,Pragma Source_File_Name}, and +It cannot appear after a @ref{f1,,Pragma Source_File_Name}, and most importantly, once pragma Source_File_Name_Project appears, no further Source_File_Name pragmas are allowed. @@ -7650,7 +7670,7 @@ Source_File_Name or Source_File_Name_Project pragmas (which would not be known to the project manager). @node Pragma Source_Reference,Pragma SPARK_Mode,Pragma Source_File_Name_Project,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-source-reference}@anchor{f2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-source-reference}@anchor{f4} @section Pragma Source_Reference @@ -7674,7 +7694,7 @@ string expression other than a string literal. This is because its value is needed for error messages issued by all phases of the compiler. @node Pragma SPARK_Mode,Pragma Static_Elaboration_Desired,Pragma Source_Reference,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id45}@anchor{f3}@anchor{gnat_rm/implementation_defined_pragmas pragma-spark-mode}@anchor{f4} +@anchor{gnat_rm/implementation_defined_pragmas id46}@anchor{f5}@anchor{gnat_rm/implementation_defined_pragmas pragma-spark-mode}@anchor{f6} @section Pragma SPARK_Mode @@ -7756,7 +7776,7 @@ SPARK_Mode (@code{Off}), then that pragma will need to be repeated in the package body. @node Pragma Static_Elaboration_Desired,Pragma Stream_Convert,Pragma SPARK_Mode,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-static-elaboration-desired}@anchor{f5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-static-elaboration-desired}@anchor{f7} @section Pragma Static_Elaboration_Desired @@ -7780,7 +7800,7 @@ construction of larger aggregates with static components that include an others choice.) @node Pragma Stream_Convert,Pragma Style_Checks,Pragma Static_Elaboration_Desired,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-stream-convert}@anchor{f6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-stream-convert}@anchor{f8} @section Pragma Stream_Convert @@ -7857,7 +7877,7 @@ the pragma is silently ignored, and the default implementation of the stream attributes is used instead. @node Pragma Style_Checks,Pragma Subprogram_Variant,Pragma Stream_Convert,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-style-checks}@anchor{f7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-style-checks}@anchor{f9} @section Pragma Style_Checks @@ -7930,7 +7950,7 @@ Rf2 : Integer := ARG; -- OK, no error @end example @node Pragma Subprogram_Variant,Pragma Subtitle,Pragma Style_Checks,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-subprogram-variant}@anchor{f8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-subprogram-variant}@anchor{fa} @section Pragma Subprogram_Variant @@ -7962,7 +7982,7 @@ the implementation-defined @code{Subprogram_Variant} aspect, and shares its restrictions and semantics. @node Pragma Subtitle,Pragma Suppress,Pragma Subprogram_Variant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-subtitle}@anchor{f9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-subtitle}@anchor{fb} @section Pragma Subtitle @@ -7976,7 +7996,7 @@ This pragma is recognized for compatibility with other Ada compilers but is ignored by GNAT. @node Pragma Suppress,Pragma Suppress_All,Pragma Subtitle,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress}@anchor{fa} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress}@anchor{fc} @section Pragma Suppress @@ -8049,7 +8069,7 @@ Of course, run-time checks are omitted whenever the compiler can prove that they will not fail, whether or not checks are suppressed. @node Pragma Suppress_All,Pragma Suppress_Debug_Info,Pragma Suppress,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-all}@anchor{fb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-all}@anchor{fd} @section Pragma Suppress_All @@ -8068,7 +8088,7 @@ The use of the standard Ada pragma @code{Suppress (All_Checks)} as a normal configuration pragma is the preferred usage in GNAT. @node Pragma Suppress_Debug_Info,Pragma Suppress_Exception_Locations,Pragma Suppress_All,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id46}@anchor{fc}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-debug-info}@anchor{fd} +@anchor{gnat_rm/implementation_defined_pragmas id47}@anchor{fe}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-debug-info}@anchor{ff} @section Pragma Suppress_Debug_Info @@ -8083,7 +8103,7 @@ for the specified entity. It is intended primarily for use in debugging the debugger, and navigating around debugger problems. @node Pragma Suppress_Exception_Locations,Pragma Suppress_Initialization,Pragma Suppress_Debug_Info,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-exception-locations}@anchor{fe} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-exception-locations}@anchor{100} @section Pragma Suppress_Exception_Locations @@ -8106,7 +8126,7 @@ a partition, so it is fine to have some units within a partition compiled with this pragma and others compiled in normal mode without it. @node Pragma Suppress_Initialization,Pragma Task_Name,Pragma Suppress_Exception_Locations,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id47}@anchor{ff}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-initialization}@anchor{100} +@anchor{gnat_rm/implementation_defined_pragmas id48}@anchor{101}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-initialization}@anchor{102} @section Pragma Suppress_Initialization @@ -8151,7 +8171,7 @@ is suppressed, just as though its subtype had been given in a pragma Suppress_Initialization, as described above. @node Pragma Task_Name,Pragma Task_Storage,Pragma Suppress_Initialization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-task-name}@anchor{101} +@anchor{gnat_rm/implementation_defined_pragmas pragma-task-name}@anchor{103} @section Pragma Task_Name @@ -8207,7 +8227,7 @@ end; @end example @node Pragma Task_Storage,Pragma Test_Case,Pragma Task_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-task-storage}@anchor{102} +@anchor{gnat_rm/implementation_defined_pragmas pragma-task-storage}@anchor{104} @section Pragma Task_Storage @@ -8227,7 +8247,7 @@ created, depending on the target. This pragma can appear anywhere a type. @node Pragma Test_Case,Pragma Thread_Local_Storage,Pragma Task_Storage,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id48}@anchor{103}@anchor{gnat_rm/implementation_defined_pragmas pragma-test-case}@anchor{104} +@anchor{gnat_rm/implementation_defined_pragmas id49}@anchor{105}@anchor{gnat_rm/implementation_defined_pragmas pragma-test-case}@anchor{106} @section Pragma Test_Case @@ -8283,7 +8303,7 @@ postcondition. Mode @code{Robustness} indicates that the precondition and postcondition of the subprogram should be ignored for this test case. @node Pragma Thread_Local_Storage,Pragma Time_Slice,Pragma Test_Case,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id49}@anchor{105}@anchor{gnat_rm/implementation_defined_pragmas pragma-thread-local-storage}@anchor{106} +@anchor{gnat_rm/implementation_defined_pragmas id50}@anchor{107}@anchor{gnat_rm/implementation_defined_pragmas pragma-thread-local-storage}@anchor{108} @section Pragma Thread_Local_Storage @@ -8321,7 +8341,7 @@ If this pragma is used on a system where @code{TLS} is not supported, then an error message will be generated and the program will be rejected. @node Pragma Time_Slice,Pragma Title,Pragma Thread_Local_Storage,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-time-slice}@anchor{107} +@anchor{gnat_rm/implementation_defined_pragmas pragma-time-slice}@anchor{109} @section Pragma Time_Slice @@ -8337,7 +8357,7 @@ It is ignored if it is used in a system that does not allow this control, or if it appears in other than the main program unit. @node Pragma Title,Pragma Type_Invariant,Pragma Time_Slice,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-title}@anchor{108} +@anchor{gnat_rm/implementation_defined_pragmas pragma-title}@anchor{10a} @section Pragma Title @@ -8362,7 +8382,7 @@ notation is used, and named and positional notation can be mixed following the normal rules for procedure calls in Ada. @node Pragma Type_Invariant,Pragma Type_Invariant_Class,Pragma Title,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant}@anchor{109} +@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant}@anchor{10b} @section Pragma Type_Invariant @@ -8383,7 +8403,7 @@ controlled by the assertion identifier @code{Type_Invariant} rather than @code{Invariant}. @node Pragma Type_Invariant_Class,Pragma Unchecked_Union,Pragma Type_Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id50}@anchor{10a}@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant-class}@anchor{10b} +@anchor{gnat_rm/implementation_defined_pragmas id51}@anchor{10c}@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant-class}@anchor{10d} @section Pragma Type_Invariant_Class @@ -8410,7 +8430,7 @@ policy that controls this pragma is @code{Type_Invariant'Class}, not @code{Type_Invariant_Class}. @node Pragma Unchecked_Union,Pragma Unevaluated_Use_Of_Old,Pragma Type_Invariant_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unchecked-union}@anchor{10c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unchecked-union}@anchor{10e} @section Pragma Unchecked_Union @@ -8430,7 +8450,7 @@ version in all language modes (Ada 83, Ada 95, and Ada 2005). For full details, consult the Ada 2012 Reference Manual, section B.3.3. @node Pragma Unevaluated_Use_Of_Old,Pragma User_Aspect_Definition,Pragma Unchecked_Union,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unevaluated-use-of-old}@anchor{10d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unevaluated-use-of-old}@anchor{10f} @section Pragma Unevaluated_Use_Of_Old @@ -8485,7 +8505,7 @@ uses up to the end of the corresponding statement sequence or sequence of package declarations. @node Pragma User_Aspect_Definition,Pragma Unimplemented_Unit,Pragma Unevaluated_Use_Of_Old,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-user-aspect-definition}@anchor{10e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-user-aspect-definition}@anchor{110} @section Pragma User_Aspect_Definition @@ -8517,7 +8537,7 @@ pragma. If multiple definitions are visible for some aspect at some point, then the definitions must agree. A predefined aspect cannot be redefined. @node Pragma Unimplemented_Unit,Pragma Universal_Aliasing,Pragma User_Aspect_Definition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unimplemented-unit}@anchor{10f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unimplemented-unit}@anchor{111} @section Pragma Unimplemented_Unit @@ -8537,7 +8557,7 @@ The abort only happens if code is being generated. Thus you can use specs of unimplemented packages in syntax or semantic checking mode. @node Pragma Universal_Aliasing,Pragma Unmodified,Pragma Unimplemented_Unit,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id51}@anchor{110}@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-aliasing}@anchor{111} +@anchor{gnat_rm/implementation_defined_pragmas id52}@anchor{112}@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-aliasing}@anchor{113} @section Pragma Universal_Aliasing @@ -8555,7 +8575,7 @@ they need to be suppressed, see the section on @code{Optimization and Strict Aliasing} in the @cite{GNAT User’s Guide}. @node Pragma Unmodified,Pragma Unreferenced,Pragma Universal_Aliasing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id52}@anchor{112}@anchor{gnat_rm/implementation_defined_pragmas pragma-unmodified}@anchor{113} +@anchor{gnat_rm/implementation_defined_pragmas id53}@anchor{114}@anchor{gnat_rm/implementation_defined_pragmas pragma-unmodified}@anchor{115} @section Pragma Unmodified @@ -8589,7 +8609,7 @@ Thus it is never necessary to use @code{pragma Unmodified} for such variables, though it is harmless to do so. @node Pragma Unreferenced,Pragma Unreferenced_Objects,Pragma Unmodified,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id53}@anchor{114}@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced}@anchor{115} +@anchor{gnat_rm/implementation_defined_pragmas id54}@anchor{116}@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced}@anchor{117} @section Pragma Unreferenced @@ -8635,7 +8655,7 @@ Note that if a warning is desired for all calls to a given subprogram, regardless of whether they occur in the same unit as the subprogram declaration, then this pragma should not be used (calls from another unit would not be flagged); pragma Obsolescent can be used instead -for this purpose, see @ref{b3,,Pragma Obsolescent}. +for this purpose, see @ref{b5,,Pragma Obsolescent}. The second form of pragma @code{Unreferenced} is used within a context clause. In this case the arguments must be unit names of units previously @@ -8651,7 +8671,7 @@ Thus it is never necessary to use @code{pragma Unreferenced} for such variables, though it is harmless to do so. @node Pragma Unreferenced_Objects,Pragma Unreserve_All_Interrupts,Pragma Unreferenced,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id54}@anchor{116}@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced-objects}@anchor{117} +@anchor{gnat_rm/implementation_defined_pragmas id55}@anchor{118}@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced-objects}@anchor{119} @section Pragma Unreferenced_Objects @@ -8676,7 +8696,7 @@ compiler will automatically suppress unwanted warnings about these variables not being referenced. @node Pragma Unreserve_All_Interrupts,Pragma Unsuppress,Pragma Unreferenced_Objects,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unreserve-all-interrupts}@anchor{118} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unreserve-all-interrupts}@anchor{11a} @section Pragma Unreserve_All_Interrupts @@ -8712,7 +8732,7 @@ handled, see pragma @code{Interrupt_State}, which subsumes the functionality of the @code{Unreserve_All_Interrupts} pragma. @node Pragma Unsuppress,Pragma Unused,Pragma Unreserve_All_Interrupts,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unsuppress}@anchor{119} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unsuppress}@anchor{11b} @section Pragma Unsuppress @@ -8748,7 +8768,7 @@ number of implementation-defined check names. See the description of pragma @code{Suppress} for full details. @node Pragma Unused,Pragma Use_VADS_Size,Pragma Unsuppress,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id55}@anchor{11a}@anchor{gnat_rm/implementation_defined_pragmas pragma-unused}@anchor{11b} +@anchor{gnat_rm/implementation_defined_pragmas id56}@anchor{11c}@anchor{gnat_rm/implementation_defined_pragmas pragma-unused}@anchor{11d} @section Pragma Unused @@ -8782,7 +8802,7 @@ Thus it is never necessary to use @code{pragma Unused} for such variables, though it is harmless to do so. @node Pragma Use_VADS_Size,Pragma Validity_Checks,Pragma Unused,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-use-vads-size}@anchor{11c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-use-vads-size}@anchor{11e} @section Pragma Use_VADS_Size @@ -8806,7 +8826,7 @@ as implemented in the VADS compiler. See description of the VADS_Size attribute for further details. @node Pragma Validity_Checks,Pragma Volatile,Pragma Use_VADS_Size,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-validity-checks}@anchor{11d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-validity-checks}@anchor{11f} @section Pragma Validity_Checks @@ -8862,7 +8882,7 @@ A := C; -- C will be validity checked @end example @node Pragma Volatile,Pragma Volatile_Full_Access,Pragma Validity_Checks,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id56}@anchor{11e}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile}@anchor{11f} +@anchor{gnat_rm/implementation_defined_pragmas id57}@anchor{120}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile}@anchor{121} @section Pragma Volatile @@ -8880,7 +8900,7 @@ implementation of pragma Volatile is upwards compatible with the implementation in DEC Ada 83. @node Pragma Volatile_Full_Access,Pragma Volatile_Function,Pragma Volatile,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id57}@anchor{120}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-full-access}@anchor{121} +@anchor{gnat_rm/implementation_defined_pragmas id58}@anchor{122}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-full-access}@anchor{123} @section Pragma Volatile_Full_Access @@ -8906,7 +8926,7 @@ is not to the whole object; the compiler is allowed (and generally will) access only part of the object in this case. @node Pragma Volatile_Function,Pragma Warning_As_Error,Pragma Volatile_Full_Access,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id58}@anchor{122}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-function}@anchor{123} +@anchor{gnat_rm/implementation_defined_pragmas id59}@anchor{124}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-function}@anchor{125} @section Pragma Volatile_Function @@ -8920,7 +8940,7 @@ For the semantics of this pragma, see the entry for aspect @code{Volatile_Functi in the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Warning_As_Error,Pragma Warnings,Pragma Volatile_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-warning-as-error}@anchor{124} +@anchor{gnat_rm/implementation_defined_pragmas pragma-warning-as-error}@anchor{126} @section Pragma Warning_As_Error @@ -8960,7 +8980,7 @@ you can use multiple pragma Warning_As_Error. The above use of patterns to match the message applies only to warning messages generated by the front end. This pragma can also be applied to -warnings provided by the back end and mentioned in @ref{125,,Pragma Warnings}. +warnings provided by the back end and mentioned in @ref{127,,Pragma Warnings}. By using a single full `-Wxxx' switch in the pragma, such warnings can also be treated as errors. @@ -9010,7 +9030,7 @@ the tag is changed from “warning:” to “error:” and the string “[warning-as-error]” is appended to the end of the message. @node Pragma Warnings,Pragma Weak_External,Pragma Warning_As_Error,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id59}@anchor{126}@anchor{gnat_rm/implementation_defined_pragmas pragma-warnings}@anchor{125} +@anchor{gnat_rm/implementation_defined_pragmas id60}@anchor{128}@anchor{gnat_rm/implementation_defined_pragmas pragma-warnings}@anchor{127} @section Pragma Warnings @@ -9166,7 +9186,7 @@ selectively for each tool, and as a consequence to detect useless pragma Warnings with switch @code{-gnatw.w}. @node Pragma Weak_External,Pragma Wide_Character_Encoding,Pragma Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-weak-external}@anchor{127} +@anchor{gnat_rm/implementation_defined_pragmas pragma-weak-external}@anchor{129} @section Pragma Weak_External @@ -9217,7 +9237,7 @@ end External_Module; @end example @node Pragma Wide_Character_Encoding,,Pragma Weak_External,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-wide-character-encoding}@anchor{128} +@anchor{gnat_rm/implementation_defined_pragmas pragma-wide-character-encoding}@anchor{12a} @section Pragma Wide_Character_Encoding @@ -9248,7 +9268,7 @@ encoding within that file, and does not affect withed units, specs, or subunits. @node Implementation Defined Aspects,Implementation Defined Attributes,Implementation Defined Pragmas,Top -@anchor{gnat_rm/implementation_defined_aspects doc}@anchor{129}@anchor{gnat_rm/implementation_defined_aspects id1}@anchor{12a}@anchor{gnat_rm/implementation_defined_aspects implementation-defined-aspects}@anchor{12b} +@anchor{gnat_rm/implementation_defined_aspects doc}@anchor{12b}@anchor{gnat_rm/implementation_defined_aspects id1}@anchor{12c}@anchor{gnat_rm/implementation_defined_aspects implementation-defined-aspects}@anchor{12d} @chapter Implementation Defined Aspects @@ -9336,6 +9356,7 @@ or attribute definition clause. * Aspect No_Caching:: * Aspect No_Elaboration_Code_All:: * Aspect No_Inline:: +* Aspect No_Raise:: * Aspect No_Tagged_Streams:: * Aspect No_Task_Parts:: * Aspect Object_Size:: @@ -9375,7 +9396,7 @@ or attribute definition clause. @end menu @node Aspect Abstract_State,Aspect Always_Terminates,,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-abstract-state}@anchor{12c} +@anchor{gnat_rm/implementation_defined_aspects aspect-abstract-state}@anchor{12e} @section Aspect Abstract_State @@ -9384,7 +9405,7 @@ or attribute definition clause. This aspect is equivalent to @ref{1e,,pragma Abstract_State}. @node Aspect Always_Terminates,Aspect Annotate,Aspect Abstract_State,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-always-terminates}@anchor{12d} +@anchor{gnat_rm/implementation_defined_aspects aspect-always-terminates}@anchor{12f} @section Aspect Always_Terminates @@ -9393,7 +9414,7 @@ This aspect is equivalent to @ref{1e,,pragma Abstract_State}. This boolean aspect is equivalent to @ref{29,,pragma Always_Terminates}. @node Aspect Annotate,Aspect Async_Readers,Aspect Always_Terminates,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-annotate}@anchor{12e} +@anchor{gnat_rm/implementation_defined_aspects aspect-annotate}@anchor{130} @section Aspect Annotate @@ -9420,7 +9441,7 @@ Equivalent to @code{pragma Annotate (ID, ID @{, ARG@}, Entity => Name);} @end table @node Aspect Async_Readers,Aspect Async_Writers,Aspect Annotate,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-async-readers}@anchor{12f} +@anchor{gnat_rm/implementation_defined_aspects aspect-async-readers}@anchor{131} @section Aspect Async_Readers @@ -9429,7 +9450,7 @@ Equivalent to @code{pragma Annotate (ID, ID @{, ARG@}, Entity => Name);} This boolean aspect is equivalent to @ref{32,,pragma Async_Readers}. @node Aspect Async_Writers,Aspect Constant_After_Elaboration,Aspect Async_Readers,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-async-writers}@anchor{130} +@anchor{gnat_rm/implementation_defined_aspects aspect-async-writers}@anchor{132} @section Aspect Async_Writers @@ -9438,7 +9459,7 @@ This boolean aspect is equivalent to @ref{32,,pragma Async_Readers}. This boolean aspect is equivalent to @ref{34,,pragma Async_Writers}. @node Aspect Constant_After_Elaboration,Aspect Contract_Cases,Aspect Async_Writers,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-constant-after-elaboration}@anchor{131} +@anchor{gnat_rm/implementation_defined_aspects aspect-constant-after-elaboration}@anchor{133} @section Aspect Constant_After_Elaboration @@ -9447,7 +9468,7 @@ This boolean aspect is equivalent to @ref{34,,pragma Async_Writers}. This aspect is equivalent to @ref{44,,pragma Constant_After_Elaboration}. @node Aspect Contract_Cases,Aspect Depends,Aspect Constant_After_Elaboration,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-contract-cases}@anchor{132} +@anchor{gnat_rm/implementation_defined_aspects aspect-contract-cases}@anchor{134} @section Aspect Contract_Cases @@ -9458,7 +9479,7 @@ of clauses being enclosed in parentheses so that syntactically it is an aggregate. @node Aspect Depends,Aspect Default_Initial_Condition,Aspect Contract_Cases,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-depends}@anchor{133} +@anchor{gnat_rm/implementation_defined_aspects aspect-depends}@anchor{135} @section Aspect Depends @@ -9467,7 +9488,7 @@ aggregate. This aspect is equivalent to @ref{56,,pragma Depends}. @node Aspect Default_Initial_Condition,Aspect Dimension,Aspect Depends,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-default-initial-condition}@anchor{134} +@anchor{gnat_rm/implementation_defined_aspects aspect-default-initial-condition}@anchor{136} @section Aspect Default_Initial_Condition @@ -9476,7 +9497,7 @@ This aspect is equivalent to @ref{56,,pragma Depends}. This aspect is equivalent to @ref{52,,pragma Default_Initial_Condition}. @node Aspect Dimension,Aspect Dimension_System,Aspect Default_Initial_Condition,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-dimension}@anchor{135} +@anchor{gnat_rm/implementation_defined_aspects aspect-dimension}@anchor{137} @section Aspect Dimension @@ -9512,7 +9533,7 @@ Note that when the dimensioned type is an integer type, then any dimension value must be an integer literal. @node Aspect Dimension_System,Aspect Disable_Controlled,Aspect Dimension,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-dimension-system}@anchor{136} +@anchor{gnat_rm/implementation_defined_aspects aspect-dimension-system}@anchor{138} @section Aspect Dimension_System @@ -9572,7 +9593,7 @@ See section ‘Performing Dimensionality Analysis in GNAT’ in the GNAT Users Guide for detailed examples of use of the dimension system. @node Aspect Disable_Controlled,Aspect Effective_Reads,Aspect Dimension_System,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-disable-controlled}@anchor{137} +@anchor{gnat_rm/implementation_defined_aspects aspect-disable-controlled}@anchor{139} @section Aspect Disable_Controlled @@ -9585,7 +9606,7 @@ where for example you might want a record to be controlled or not depending on whether some run-time check is enabled or suppressed. @node Aspect Effective_Reads,Aspect Effective_Writes,Aspect Disable_Controlled,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-effective-reads}@anchor{138} +@anchor{gnat_rm/implementation_defined_aspects aspect-effective-reads}@anchor{13a} @section Aspect Effective_Reads @@ -9594,7 +9615,7 @@ whether some run-time check is enabled or suppressed. This aspect is equivalent to @ref{5b,,pragma Effective_Reads}. @node Aspect Effective_Writes,Aspect Exceptional_Cases,Aspect Effective_Reads,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-effective-writes}@anchor{139} +@anchor{gnat_rm/implementation_defined_aspects aspect-effective-writes}@anchor{13b} @section Aspect Effective_Writes @@ -9603,7 +9624,7 @@ This aspect is equivalent to @ref{5b,,pragma Effective_Reads}. This aspect is equivalent to @ref{5d,,pragma Effective_Writes}. @node Aspect Exceptional_Cases,Aspect Extensions_Visible,Aspect Effective_Writes,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-exceptional-cases}@anchor{13a} +@anchor{gnat_rm/implementation_defined_aspects aspect-exceptional-cases}@anchor{13c} @section Aspect Exceptional_Cases @@ -9618,7 +9639,7 @@ For the syntax and semantics of this aspect, see the SPARK 2014 Reference Manual, section 6.1.9. @node Aspect Extensions_Visible,Aspect Favor_Top_Level,Aspect Exceptional_Cases,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-extensions-visible}@anchor{13b} +@anchor{gnat_rm/implementation_defined_aspects aspect-extensions-visible}@anchor{13d} @section Aspect Extensions_Visible @@ -9627,7 +9648,7 @@ Manual, section 6.1.9. This aspect is equivalent to @ref{6c,,pragma Extensions_Visible}. @node Aspect Favor_Top_Level,Aspect Ghost,Aspect Extensions_Visible,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-favor-top-level}@anchor{13c} +@anchor{gnat_rm/implementation_defined_aspects aspect-favor-top-level}@anchor{13e} @section Aspect Favor_Top_Level @@ -9636,7 +9657,7 @@ This aspect is equivalent to @ref{6c,,pragma Extensions_Visible}. This boolean aspect is equivalent to @ref{71,,pragma Favor_Top_Level}. @node Aspect Ghost,Aspect Ghost_Predicate,Aspect Favor_Top_Level,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-ghost}@anchor{13d} +@anchor{gnat_rm/implementation_defined_aspects aspect-ghost}@anchor{13f} @section Aspect Ghost @@ -9645,7 +9666,7 @@ This boolean aspect is equivalent to @ref{71,,pragma Favor_Top_Level}. This aspect is equivalent to @ref{75,,pragma Ghost}. @node Aspect Ghost_Predicate,Aspect Global,Aspect Ghost,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-ghost-predicate}@anchor{13e} +@anchor{gnat_rm/implementation_defined_aspects aspect-ghost-predicate}@anchor{140} @section Aspect Ghost_Predicate @@ -9658,7 +9679,7 @@ For the detailed semantics of this aspect, see the entry for subtype predicates in the SPARK Reference Manual, section 3.2.4. @node Aspect Global,Aspect Initial_Condition,Aspect Ghost_Predicate,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-global}@anchor{13f} +@anchor{gnat_rm/implementation_defined_aspects aspect-global}@anchor{141} @section Aspect Global @@ -9667,7 +9688,7 @@ in the SPARK Reference Manual, section 3.2.4. This aspect is equivalent to @ref{77,,pragma Global}. @node Aspect Initial_Condition,Aspect Initializes,Aspect Global,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-initial-condition}@anchor{140} +@anchor{gnat_rm/implementation_defined_aspects aspect-initial-condition}@anchor{142} @section Aspect Initial_Condition @@ -9676,7 +9697,7 @@ This aspect is equivalent to @ref{77,,pragma Global}. This aspect is equivalent to @ref{84,,pragma Initial_Condition}. @node Aspect Initializes,Aspect Inline_Always,Aspect Initial_Condition,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-initializes}@anchor{141} +@anchor{gnat_rm/implementation_defined_aspects aspect-initializes}@anchor{143} @section Aspect Initializes @@ -9685,7 +9706,7 @@ This aspect is equivalent to @ref{84,,pragma Initial_Condition}. This aspect is equivalent to @ref{87,,pragma Initializes}. @node Aspect Inline_Always,Aspect Invariant,Aspect Initializes,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-inline-always}@anchor{142} +@anchor{gnat_rm/implementation_defined_aspects aspect-inline-always}@anchor{144} @section Aspect Inline_Always @@ -9694,7 +9715,7 @@ This aspect is equivalent to @ref{87,,pragma Initializes}. This boolean aspect is equivalent to @ref{89,,pragma Inline_Always}. @node Aspect Invariant,Aspect Invariant’Class,Aspect Inline_Always,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-invariant}@anchor{143} +@anchor{gnat_rm/implementation_defined_aspects aspect-invariant}@anchor{145} @section Aspect Invariant @@ -9705,18 +9726,18 @@ synonym for the language defined aspect @code{Type_Invariant} except that it is separately controllable using pragma @code{Assertion_Policy}. @node Aspect Invariant’Class,Aspect Iterable,Aspect Invariant,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-invariant-class}@anchor{144} +@anchor{gnat_rm/implementation_defined_aspects aspect-invariant-class}@anchor{146} @section Aspect Invariant’Class @geindex Invariant'Class -This aspect is equivalent to @ref{10b,,pragma Type_Invariant_Class}. It is a +This aspect is equivalent to @ref{10d,,pragma Type_Invariant_Class}. It is a synonym for the language defined aspect @code{Type_Invariant'Class} except that it is separately controllable using pragma @code{Assertion_Policy}. @node Aspect Iterable,Aspect Linker_Section,Aspect Invariant’Class,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-iterable}@anchor{145} +@anchor{gnat_rm/implementation_defined_aspects aspect-iterable}@anchor{147} @section Aspect Iterable @@ -9800,7 +9821,7 @@ function Get_Element (Cont : Container; Position : Cursor) return Element_Type; This aspect is used in the GNAT-defined formal container packages. @node Aspect Linker_Section,Aspect Local_Restrictions,Aspect Iterable,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-linker-section}@anchor{146} +@anchor{gnat_rm/implementation_defined_aspects aspect-linker-section}@anchor{148} @section Aspect Linker_Section @@ -9809,7 +9830,7 @@ This aspect is used in the GNAT-defined formal container packages. This aspect is equivalent to @ref{99,,pragma Linker_Section}. @node Aspect Local_Restrictions,Aspect Lock_Free,Aspect Linker_Section,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-local-restrictions}@anchor{147} +@anchor{gnat_rm/implementation_defined_aspects aspect-local-restrictions}@anchor{149} @section Aspect Local_Restrictions @@ -9863,7 +9884,7 @@ case of a declaration that occurs within nested packages that each have a Local_Restrictions specification). @node Aspect Lock_Free,Aspect Max_Queue_Length,Aspect Local_Restrictions,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-lock-free}@anchor{148} +@anchor{gnat_rm/implementation_defined_aspects aspect-lock-free}@anchor{14a} @section Aspect Lock_Free @@ -9872,7 +9893,7 @@ a Local_Restrictions specification). This boolean aspect is equivalent to @ref{9b,,pragma Lock_Free}. @node Aspect Max_Queue_Length,Aspect No_Caching,Aspect Lock_Free,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-max-queue-length}@anchor{149} +@anchor{gnat_rm/implementation_defined_aspects aspect-max-queue-length}@anchor{14b} @section Aspect Max_Queue_Length @@ -9881,7 +9902,7 @@ This boolean aspect is equivalent to @ref{9b,,pragma Lock_Free}. This aspect is equivalent to @ref{a3,,pragma Max_Queue_Length}. @node Aspect No_Caching,Aspect No_Elaboration_Code_All,Aspect Max_Queue_Length,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-caching}@anchor{14a} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-caching}@anchor{14c} @section Aspect No_Caching @@ -9890,7 +9911,7 @@ This aspect is equivalent to @ref{a3,,pragma Max_Queue_Length}. This boolean aspect is equivalent to @ref{a6,,pragma No_Caching}. @node Aspect No_Elaboration_Code_All,Aspect No_Inline,Aspect No_Caching,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-elaboration-code-all}@anchor{14b} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-elaboration-code-all}@anchor{14d} @section Aspect No_Elaboration_Code_All @@ -9899,8 +9920,8 @@ This boolean aspect is equivalent to @ref{a6,,pragma No_Caching}. This aspect is equivalent to @ref{a9,,pragma No_Elaboration_Code_All} for a program unit. -@node Aspect No_Inline,Aspect No_Tagged_Streams,Aspect No_Elaboration_Code_All,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-inline}@anchor{14c} +@node Aspect No_Inline,Aspect No_Raise,Aspect No_Elaboration_Code_All,Implementation Defined Aspects +@anchor{gnat_rm/implementation_defined_aspects aspect-no-inline}@anchor{14e} @section Aspect No_Inline @@ -9908,19 +9929,28 @@ for a program unit. This boolean aspect is equivalent to @ref{ac,,pragma No_Inline}. -@node Aspect No_Tagged_Streams,Aspect No_Task_Parts,Aspect No_Inline,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-tagged-streams}@anchor{14d} +@node Aspect No_Raise,Aspect No_Tagged_Streams,Aspect No_Inline,Implementation Defined Aspects +@anchor{gnat_rm/implementation_defined_aspects aspect-no-raise}@anchor{14f} +@section Aspect No_Raise + + +@geindex No_Raise + +This boolean aspect is equivalent to @ref{ae,,pragma No_Raise}. + +@node Aspect No_Tagged_Streams,Aspect No_Task_Parts,Aspect No_Raise,Implementation Defined Aspects +@anchor{gnat_rm/implementation_defined_aspects aspect-no-tagged-streams}@anchor{150} @section Aspect No_Tagged_Streams @geindex No_Tagged_Streams -This aspect is equivalent to @ref{b0,,pragma No_Tagged_Streams} with an +This aspect is equivalent to @ref{b2,,pragma No_Tagged_Streams} with an argument specifying a root tagged type (thus this aspect can only be applied to such a type). @node Aspect No_Task_Parts,Aspect Object_Size,Aspect No_Tagged_Streams,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-task-parts}@anchor{14e} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-task-parts}@anchor{151} @section Aspect No_Task_Parts @@ -9936,51 +9966,51 @@ away certain tasking-related code that would otherwise be needed for T’Class, because descendants of T might contain tasks. @node Aspect Object_Size,Aspect Obsolescent,Aspect No_Task_Parts,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-object-size}@anchor{14f} +@anchor{gnat_rm/implementation_defined_aspects aspect-object-size}@anchor{152} @section Aspect Object_Size @geindex Object_Size -This aspect is equivalent to @ref{150,,attribute Object_Size}. +This aspect is equivalent to @ref{153,,attribute Object_Size}. @node Aspect Obsolescent,Aspect Part_Of,Aspect Object_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-obsolescent}@anchor{151} +@anchor{gnat_rm/implementation_defined_aspects aspect-obsolescent}@anchor{154} @section Aspect Obsolescent @geindex Obsolescent -This aspect is equivalent to @ref{b3,,pragma Obsolescent}. Note that the +This aspect is equivalent to @ref{b5,,pragma Obsolescent}. Note that the evaluation of this aspect happens at the point of occurrence, it is not delayed until the freeze point. @node Aspect Part_Of,Aspect Persistent_BSS,Aspect Obsolescent,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-part-of}@anchor{152} +@anchor{gnat_rm/implementation_defined_aspects aspect-part-of}@anchor{155} @section Aspect Part_Of @geindex Part_Of -This aspect is equivalent to @ref{b9,,pragma Part_Of}. +This aspect is equivalent to @ref{bb,,pragma Part_Of}. @node Aspect Persistent_BSS,Aspect Predicate,Aspect Part_Of,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-persistent-bss}@anchor{153} +@anchor{gnat_rm/implementation_defined_aspects aspect-persistent-bss}@anchor{156} @section Aspect Persistent_BSS @geindex Persistent_BSS -This boolean aspect is equivalent to @ref{bd,,pragma Persistent_BSS}. +This boolean aspect is equivalent to @ref{bf,,pragma Persistent_BSS}. @node Aspect Predicate,Aspect Pure_Function,Aspect Persistent_BSS,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-predicate}@anchor{154} +@anchor{gnat_rm/implementation_defined_aspects aspect-predicate}@anchor{157} @section Aspect Predicate @geindex Predicate -This aspect is equivalent to @ref{c4,,pragma Predicate}. It is thus +This aspect is equivalent to @ref{c6,,pragma Predicate}. It is thus similar to the language defined aspects @code{Dynamic_Predicate} and @code{Static_Predicate} except that whether the resulting predicate is static or dynamic is controlled by the form of the @@ -9988,52 +10018,52 @@ expression. It is also separately controllable using pragma @code{Assertion_Policy}. @node Aspect Pure_Function,Aspect Refined_Depends,Aspect Predicate,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-pure-function}@anchor{155} +@anchor{gnat_rm/implementation_defined_aspects aspect-pure-function}@anchor{158} @section Aspect Pure_Function @geindex Pure_Function -This boolean aspect is equivalent to @ref{d0,,pragma Pure_Function}. +This boolean aspect is equivalent to @ref{d2,,pragma Pure_Function}. @node Aspect Refined_Depends,Aspect Refined_Global,Aspect Pure_Function,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-depends}@anchor{156} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-depends}@anchor{159} @section Aspect Refined_Depends @geindex Refined_Depends -This aspect is equivalent to @ref{d4,,pragma Refined_Depends}. +This aspect is equivalent to @ref{d6,,pragma Refined_Depends}. @node Aspect Refined_Global,Aspect Refined_Post,Aspect Refined_Depends,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-global}@anchor{157} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-global}@anchor{15a} @section Aspect Refined_Global @geindex Refined_Global -This aspect is equivalent to @ref{d6,,pragma Refined_Global}. +This aspect is equivalent to @ref{d8,,pragma Refined_Global}. @node Aspect Refined_Post,Aspect Refined_State,Aspect Refined_Global,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-post}@anchor{158} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-post}@anchor{15b} @section Aspect Refined_Post @geindex Refined_Post -This aspect is equivalent to @ref{d8,,pragma Refined_Post}. +This aspect is equivalent to @ref{da,,pragma Refined_Post}. @node Aspect Refined_State,Aspect Relaxed_Initialization,Aspect Refined_Post,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-state}@anchor{159} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-state}@anchor{15c} @section Aspect Refined_State @geindex Refined_State -This aspect is equivalent to @ref{da,,pragma Refined_State}. +This aspect is equivalent to @ref{dc,,pragma Refined_State}. @node Aspect Relaxed_Initialization,Aspect Remote_Access_Type,Aspect Refined_State,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-relaxed-initialization}@anchor{15a} +@anchor{gnat_rm/implementation_defined_aspects aspect-relaxed-initialization}@anchor{15d} @section Aspect Relaxed_Initialization @@ -10043,82 +10073,82 @@ For the syntax and semantics of this aspect, see the SPARK 2014 Reference Manual, section 6.10. @node Aspect Remote_Access_Type,Aspect Scalar_Storage_Order,Aspect Relaxed_Initialization,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-remote-access-type}@anchor{15b} +@anchor{gnat_rm/implementation_defined_aspects aspect-remote-access-type}@anchor{15e} @section Aspect Remote_Access_Type @geindex Remote_Access_Type -This aspect is equivalent to @ref{dd,,pragma Remote_Access_Type}. +This aspect is equivalent to @ref{df,,pragma Remote_Access_Type}. @node Aspect Scalar_Storage_Order,Aspect Secondary_Stack_Size,Aspect Remote_Access_Type,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-scalar-storage-order}@anchor{15c} +@anchor{gnat_rm/implementation_defined_aspects aspect-scalar-storage-order}@anchor{15f} @section Aspect Scalar_Storage_Order @geindex Scalar_Storage_Order -This aspect is equivalent to a @ref{15d,,attribute Scalar_Storage_Order}. +This aspect is equivalent to a @ref{160,,attribute Scalar_Storage_Order}. @node Aspect Secondary_Stack_Size,Aspect Shared,Aspect Scalar_Storage_Order,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-secondary-stack-size}@anchor{15e} +@anchor{gnat_rm/implementation_defined_aspects aspect-secondary-stack-size}@anchor{161} @section Aspect Secondary_Stack_Size @geindex Secondary_Stack_Size -This aspect is equivalent to @ref{e3,,pragma Secondary_Stack_Size}. +This aspect is equivalent to @ref{e5,,pragma Secondary_Stack_Size}. @node Aspect Shared,Aspect Side_Effects,Aspect Secondary_Stack_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-shared}@anchor{15f} +@anchor{gnat_rm/implementation_defined_aspects aspect-shared}@anchor{162} @section Aspect Shared @geindex Shared -This boolean aspect is equivalent to @ref{e6,,pragma Shared} +This boolean aspect is equivalent to @ref{e8,,pragma Shared} and is thus a synonym for aspect @code{Atomic}. @node Aspect Side_Effects,Aspect Simple_Storage_Pool,Aspect Shared,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-side-effects}@anchor{160} +@anchor{gnat_rm/implementation_defined_aspects aspect-side-effects}@anchor{163} @section Aspect Side_Effects @geindex Side_Effects -This aspect is equivalent to @ref{ea,,pragma Side_Effects}. +This aspect is equivalent to @ref{ec,,pragma Side_Effects}. @node Aspect Simple_Storage_Pool,Aspect Simple_Storage_Pool_Type,Aspect Side_Effects,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool}@anchor{161} +@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool}@anchor{164} @section Aspect Simple_Storage_Pool @geindex Simple_Storage_Pool -This aspect is equivalent to @ref{ed,,attribute Simple_Storage_Pool}. +This aspect is equivalent to @ref{ef,,attribute Simple_Storage_Pool}. @node Aspect Simple_Storage_Pool_Type,Aspect SPARK_Mode,Aspect Simple_Storage_Pool,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool-type}@anchor{162} +@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool-type}@anchor{165} @section Aspect Simple_Storage_Pool_Type @geindex Simple_Storage_Pool_Type -This boolean aspect is equivalent to @ref{ec,,pragma Simple_Storage_Pool_Type}. +This boolean aspect is equivalent to @ref{ee,,pragma Simple_Storage_Pool_Type}. @node Aspect SPARK_Mode,Aspect Subprogram_Variant,Aspect Simple_Storage_Pool_Type,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-spark-mode}@anchor{163} +@anchor{gnat_rm/implementation_defined_aspects aspect-spark-mode}@anchor{166} @section Aspect SPARK_Mode @geindex SPARK_Mode -This aspect is equivalent to @ref{f4,,pragma SPARK_Mode} and +This aspect is equivalent to @ref{f6,,pragma SPARK_Mode} and may be specified for either or both of the specification and body of a subprogram or package. @node Aspect Subprogram_Variant,Aspect Suppress_Debug_Info,Aspect SPARK_Mode,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-subprogram-variant}@anchor{164} +@anchor{gnat_rm/implementation_defined_aspects aspect-subprogram-variant}@anchor{167} @section Aspect Subprogram_Variant @@ -10128,83 +10158,83 @@ For the syntax and semantics of this aspect, see the SPARK 2014 Reference Manual, section 6.1.8. @node Aspect Suppress_Debug_Info,Aspect Suppress_Initialization,Aspect Subprogram_Variant,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-debug-info}@anchor{165} +@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-debug-info}@anchor{168} @section Aspect Suppress_Debug_Info @geindex Suppress_Debug_Info -This boolean aspect is equivalent to @ref{fd,,pragma Suppress_Debug_Info}. +This boolean aspect is equivalent to @ref{ff,,pragma Suppress_Debug_Info}. @node Aspect Suppress_Initialization,Aspect Test_Case,Aspect Suppress_Debug_Info,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-initialization}@anchor{166} +@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-initialization}@anchor{169} @section Aspect Suppress_Initialization @geindex Suppress_Initialization -This boolean aspect is equivalent to @ref{100,,pragma Suppress_Initialization}. +This boolean aspect is equivalent to @ref{102,,pragma Suppress_Initialization}. @node Aspect Test_Case,Aspect Thread_Local_Storage,Aspect Suppress_Initialization,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-test-case}@anchor{167} +@anchor{gnat_rm/implementation_defined_aspects aspect-test-case}@anchor{16a} @section Aspect Test_Case @geindex Test_Case -This aspect is equivalent to @ref{104,,pragma Test_Case}. +This aspect is equivalent to @ref{106,,pragma Test_Case}. @node Aspect Thread_Local_Storage,Aspect Universal_Aliasing,Aspect Test_Case,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-thread-local-storage}@anchor{168} +@anchor{gnat_rm/implementation_defined_aspects aspect-thread-local-storage}@anchor{16b} @section Aspect Thread_Local_Storage @geindex Thread_Local_Storage -This boolean aspect is equivalent to @ref{106,,pragma Thread_Local_Storage}. +This boolean aspect is equivalent to @ref{108,,pragma Thread_Local_Storage}. @node Aspect Universal_Aliasing,Aspect Unmodified,Aspect Thread_Local_Storage,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-universal-aliasing}@anchor{169} +@anchor{gnat_rm/implementation_defined_aspects aspect-universal-aliasing}@anchor{16c} @section Aspect Universal_Aliasing @geindex Universal_Aliasing -This boolean aspect is equivalent to @ref{111,,pragma Universal_Aliasing}. +This boolean aspect is equivalent to @ref{113,,pragma Universal_Aliasing}. @node Aspect Unmodified,Aspect Unreferenced,Aspect Universal_Aliasing,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unmodified}@anchor{16a} +@anchor{gnat_rm/implementation_defined_aspects aspect-unmodified}@anchor{16d} @section Aspect Unmodified @geindex Unmodified -This boolean aspect is equivalent to @ref{113,,pragma Unmodified}. +This boolean aspect is equivalent to @ref{115,,pragma Unmodified}. @node Aspect Unreferenced,Aspect Unreferenced_Objects,Aspect Unmodified,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced}@anchor{16b} +@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced}@anchor{16e} @section Aspect Unreferenced @geindex Unreferenced -This boolean aspect is equivalent to @ref{115,,pragma Unreferenced}. +This boolean aspect is equivalent to @ref{117,,pragma Unreferenced}. When using the @code{-gnat2022} switch, this aspect is also supported on formal parameters, which is in particular the only form possible for expression functions. @node Aspect Unreferenced_Objects,Aspect User_Aspect,Aspect Unreferenced,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced-objects}@anchor{16c} +@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced-objects}@anchor{16f} @section Aspect Unreferenced_Objects @geindex Unreferenced_Objects -This boolean aspect is equivalent to @ref{117,,pragma Unreferenced_Objects}. +This boolean aspect is equivalent to @ref{119,,pragma Unreferenced_Objects}. @node Aspect User_Aspect,Aspect Value_Size,Aspect Unreferenced_Objects,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-user-aspect}@anchor{16d} +@anchor{gnat_rm/implementation_defined_aspects aspect-user-aspect}@anchor{170} @section Aspect User_Aspect @@ -10217,45 +10247,45 @@ replicating the set of aspect specifications associated with the named pragma-defined aspect. @node Aspect Value_Size,Aspect Volatile_Full_Access,Aspect User_Aspect,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-value-size}@anchor{16e} +@anchor{gnat_rm/implementation_defined_aspects aspect-value-size}@anchor{171} @section Aspect Value_Size @geindex Value_Size -This aspect is equivalent to @ref{16f,,attribute Value_Size}. +This aspect is equivalent to @ref{172,,attribute Value_Size}. @node Aspect Volatile_Full_Access,Aspect Volatile_Function,Aspect Value_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-full-access}@anchor{170} +@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-full-access}@anchor{173} @section Aspect Volatile_Full_Access @geindex Volatile_Full_Access -This boolean aspect is equivalent to @ref{121,,pragma Volatile_Full_Access}. +This boolean aspect is equivalent to @ref{123,,pragma Volatile_Full_Access}. @node Aspect Volatile_Function,Aspect Warnings,Aspect Volatile_Full_Access,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-function}@anchor{171} +@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-function}@anchor{174} @section Aspect Volatile_Function @geindex Volatile_Function -This boolean aspect is equivalent to @ref{123,,pragma Volatile_Function}. +This boolean aspect is equivalent to @ref{125,,pragma Volatile_Function}. @node Aspect Warnings,,Aspect Volatile_Function,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-warnings}@anchor{172} +@anchor{gnat_rm/implementation_defined_aspects aspect-warnings}@anchor{175} @section Aspect Warnings @geindex Warnings -This aspect is equivalent to the two argument form of @ref{125,,pragma Warnings}, +This aspect is equivalent to the two argument form of @ref{127,,pragma Warnings}, where the first argument is @code{ON} or @code{OFF} and the second argument is the entity. @node Implementation Defined Attributes,Standard and Implementation Defined Restrictions,Implementation Defined Aspects,Top -@anchor{gnat_rm/implementation_defined_attributes doc}@anchor{173}@anchor{gnat_rm/implementation_defined_attributes id1}@anchor{174}@anchor{gnat_rm/implementation_defined_attributes implementation-defined-attributes}@anchor{8} +@anchor{gnat_rm/implementation_defined_attributes doc}@anchor{176}@anchor{gnat_rm/implementation_defined_attributes id1}@anchor{177}@anchor{gnat_rm/implementation_defined_attributes implementation-defined-attributes}@anchor{8} @chapter Implementation Defined Attributes @@ -10361,7 +10391,7 @@ consideration, you should minimize the use of these attributes. @end menu @node Attribute Abort_Signal,Attribute Address_Size,,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-abort-signal}@anchor{175} +@anchor{gnat_rm/implementation_defined_attributes attribute-abort-signal}@anchor{178} @section Attribute Abort_Signal @@ -10375,7 +10405,7 @@ completely outside the normal semantics of Ada, for a user program to intercept the abort exception). @node Attribute Address_Size,Attribute Asm_Input,Attribute Abort_Signal,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-address-size}@anchor{176} +@anchor{gnat_rm/implementation_defined_attributes attribute-address-size}@anchor{179} @section Attribute Address_Size @@ -10391,7 +10421,7 @@ reference to System.Address’Size is nonstatic because Address is a private type. @node Attribute Asm_Input,Attribute Asm_Output,Attribute Address_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-asm-input}@anchor{177} +@anchor{gnat_rm/implementation_defined_attributes attribute-asm-input}@anchor{17a} @section Attribute Asm_Input @@ -10405,10 +10435,10 @@ to be a static expression, and is the constraint for the parameter, value to be used as the input argument. The possible values for the constant are the same as those used in the RTL, and are dependent on the configuration file used to built the GCC back end. -@ref{178,,Machine Code Insertions} +@ref{17b,,Machine Code Insertions} @node Attribute Asm_Output,Attribute Atomic_Always_Lock_Free,Attribute Asm_Input,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-asm-output}@anchor{179} +@anchor{gnat_rm/implementation_defined_attributes attribute-asm-output}@anchor{17c} @section Attribute Asm_Output @@ -10424,10 +10454,10 @@ result. The possible values for constraint are the same as those used in the RTL, and are dependent on the configuration file used to build the GCC back end. If there are no output operands, then this argument may either be omitted, or explicitly given as @code{No_Output_Operands}. -@ref{178,,Machine Code Insertions} +@ref{17b,,Machine Code Insertions} @node Attribute Atomic_Always_Lock_Free,Attribute Bit,Attribute Asm_Output,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-atomic-always-lock-free}@anchor{17a} +@anchor{gnat_rm/implementation_defined_attributes attribute-atomic-always-lock-free}@anchor{17d} @section Attribute Atomic_Always_Lock_Free @@ -10438,7 +10468,7 @@ result indicates whether atomic operations are supported by the target for the given type. @node Attribute Bit,Attribute Bit_Position,Attribute Atomic_Always_Lock_Free,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-bit}@anchor{17b} +@anchor{gnat_rm/implementation_defined_attributes attribute-bit}@anchor{17e} @section Attribute Bit @@ -10469,7 +10499,7 @@ This attribute is designed to be compatible with the DEC Ada 83 definition and implementation of the @code{Bit} attribute. @node Attribute Bit_Position,Attribute Code_Address,Attribute Bit,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-bit-position}@anchor{17c} +@anchor{gnat_rm/implementation_defined_attributes attribute-bit-position}@anchor{17f} @section Attribute Bit_Position @@ -10484,7 +10514,7 @@ type `universal_integer'. The value depends only on the field the containing record @code{R}. @node Attribute Code_Address,Attribute Compiler_Version,Attribute Bit_Position,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-code-address}@anchor{17d} +@anchor{gnat_rm/implementation_defined_attributes attribute-code-address}@anchor{180} @section Attribute Code_Address @@ -10527,7 +10557,7 @@ the same value as is returned by the corresponding @code{'Address} attribute. @node Attribute Compiler_Version,Attribute Constrained,Attribute Code_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-compiler-version}@anchor{17e} +@anchor{gnat_rm/implementation_defined_attributes attribute-compiler-version}@anchor{181} @section Attribute Compiler_Version @@ -10538,7 +10568,7 @@ prefix) yields a static string identifying the version of the compiler being used to compile the unit containing the attribute reference. @node Attribute Constrained,Attribute Default_Bit_Order,Attribute Compiler_Version,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-constrained}@anchor{17f} +@anchor{gnat_rm/implementation_defined_attributes attribute-constrained}@anchor{182} @section Attribute Constrained @@ -10553,7 +10583,7 @@ record type without discriminants is always @code{True}. This usage is compatible with older Ada compilers, including notably DEC Ada. @node Attribute Default_Bit_Order,Attribute Default_Scalar_Storage_Order,Attribute Constrained,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-default-bit-order}@anchor{180} +@anchor{gnat_rm/implementation_defined_attributes attribute-default-bit-order}@anchor{183} @section Attribute Default_Bit_Order @@ -10570,7 +10600,7 @@ as a @code{Pos} value (0 for @code{High_Order_First}, 1 for @code{Default_Bit_Order} in package @code{System}. @node Attribute Default_Scalar_Storage_Order,Attribute Deref,Attribute Default_Bit_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-default-scalar-storage-order}@anchor{181} +@anchor{gnat_rm/implementation_defined_attributes attribute-default-scalar-storage-order}@anchor{184} @section Attribute Default_Scalar_Storage_Order @@ -10587,7 +10617,7 @@ equal to @code{Default_Bit_Order} if unspecified) as a @code{System.Bit_Order} value. This is a static attribute. @node Attribute Deref,Attribute Descriptor_Size,Attribute Default_Scalar_Storage_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-deref}@anchor{182} +@anchor{gnat_rm/implementation_defined_attributes attribute-deref}@anchor{185} @section Attribute Deref @@ -10600,7 +10630,7 @@ a named access-to-@cite{typ} type, except that it yields a variable, so it can b used on the left side of an assignment. @node Attribute Descriptor_Size,Attribute Elaborated,Attribute Deref,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-descriptor-size}@anchor{183} +@anchor{gnat_rm/implementation_defined_attributes attribute-descriptor-size}@anchor{186} @section Attribute Descriptor_Size @@ -10629,7 +10659,7 @@ since @code{Positive} has an alignment of 4, the size of the descriptor is which yields a size of 32 bits, i.e. including 16 bits of padding. @node Attribute Elaborated,Attribute Elab_Body,Attribute Descriptor_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elaborated}@anchor{184} +@anchor{gnat_rm/implementation_defined_attributes attribute-elaborated}@anchor{187} @section Attribute Elaborated @@ -10644,7 +10674,7 @@ units has been completed. An exception is for units which need no elaboration, the value is always False for such units. @node Attribute Elab_Body,Attribute Elab_Spec,Attribute Elaborated,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elab-body}@anchor{185} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-body}@anchor{188} @section Attribute Elab_Body @@ -10660,7 +10690,7 @@ e.g., if it is necessary to do selective re-elaboration to fix some error. @node Attribute Elab_Spec,Attribute Elab_Subp_Body,Attribute Elab_Body,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elab-spec}@anchor{186} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-spec}@anchor{189} @section Attribute Elab_Spec @@ -10676,7 +10706,7 @@ Ada code, e.g., if it is necessary to do selective re-elaboration to fix some error. @node Attribute Elab_Subp_Body,Attribute Emax,Attribute Elab_Spec,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elab-subp-body}@anchor{187} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-subp-body}@anchor{18a} @section Attribute Elab_Subp_Body @@ -10690,7 +10720,7 @@ elaboration procedure by the binder in CodePeer mode only and is unrecognized otherwise. @node Attribute Emax,Attribute Enabled,Attribute Elab_Subp_Body,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-emax}@anchor{188} +@anchor{gnat_rm/implementation_defined_attributes attribute-emax}@anchor{18b} @section Attribute Emax @@ -10703,7 +10733,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Enabled,Attribute Enum_Rep,Attribute Emax,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-enabled}@anchor{189} +@anchor{gnat_rm/implementation_defined_attributes attribute-enabled}@anchor{18c} @section Attribute Enabled @@ -10727,7 +10757,7 @@ a @code{pragma Suppress} or @code{pragma Unsuppress} before instantiating the package or subprogram, controlling whether the check will be present. @node Attribute Enum_Rep,Attribute Enum_Val,Attribute Enabled,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-enum-rep}@anchor{18a} +@anchor{gnat_rm/implementation_defined_attributes attribute-enum-rep}@anchor{18d} @section Attribute Enum_Rep @@ -10767,7 +10797,7 @@ integer calculation is done at run time, then the call to @code{Enum_Rep} may raise @code{Constraint_Error}. @node Attribute Enum_Val,Attribute Epsilon,Attribute Enum_Rep,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-enum-val}@anchor{18b} +@anchor{gnat_rm/implementation_defined_attributes attribute-enum-val}@anchor{18e} @section Attribute Enum_Val @@ -10793,7 +10823,7 @@ absence of an enumeration representation clause. This is a static attribute (i.e., the result is static if the argument is static). @node Attribute Epsilon,Attribute Fast_Math,Attribute Enum_Val,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-epsilon}@anchor{18c} +@anchor{gnat_rm/implementation_defined_attributes attribute-epsilon}@anchor{18f} @section Attribute Epsilon @@ -10806,7 +10836,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Fast_Math,Attribute Finalization_Size,Attribute Epsilon,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-fast-math}@anchor{18d} +@anchor{gnat_rm/implementation_defined_attributes attribute-fast-math}@anchor{190} @section Attribute Fast_Math @@ -10817,7 +10847,7 @@ prefix) yields a static Boolean value that is True if pragma @code{Fast_Math} is active, and False otherwise. @node Attribute Finalization_Size,Attribute Fixed_Value,Attribute Fast_Math,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-finalization-size}@anchor{18e} +@anchor{gnat_rm/implementation_defined_attributes attribute-finalization-size}@anchor{191} @section Attribute Finalization_Size @@ -10835,7 +10865,7 @@ class-wide type whose tag denotes a type with no controlled parts. Note that only heap-allocated objects contain finalization data. @node Attribute Fixed_Value,Attribute From_Any,Attribute Finalization_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-fixed-value}@anchor{18f} +@anchor{gnat_rm/implementation_defined_attributes attribute-fixed-value}@anchor{192} @section Attribute Fixed_Value @@ -10862,7 +10892,7 @@ This attribute is primarily intended for use in implementation of the input-output functions for fixed-point values. @node Attribute From_Any,Attribute Has_Access_Values,Attribute Fixed_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-from-any}@anchor{190} +@anchor{gnat_rm/implementation_defined_attributes attribute-from-any}@anchor{193} @section Attribute From_Any @@ -10872,7 +10902,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Has_Access_Values,Attribute Has_Discriminants,Attribute From_Any,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-has-access-values}@anchor{191} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-access-values}@anchor{194} @section Attribute Has_Access_Values @@ -10890,7 +10920,7 @@ definitions. If the attribute is applied to a generic private type, it indicates whether or not the corresponding actual type has access values. @node Attribute Has_Discriminants,Attribute Has_Tagged_Values,Attribute Has_Access_Values,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-has-discriminants}@anchor{192} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-discriminants}@anchor{195} @section Attribute Has_Discriminants @@ -10906,7 +10936,7 @@ definitions. If the attribute is applied to a generic private type, it indicates whether or not the corresponding actual type has discriminants. @node Attribute Has_Tagged_Values,Attribute Img,Attribute Has_Discriminants,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-has-tagged-values}@anchor{193} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-tagged-values}@anchor{196} @section Attribute Has_Tagged_Values @@ -10923,7 +10953,7 @@ definitions. If the attribute is applied to a generic private type, it indicates whether or not the corresponding actual type has access values. @node Attribute Img,Attribute Initialized,Attribute Has_Tagged_Values,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-img}@anchor{194} +@anchor{gnat_rm/implementation_defined_attributes attribute-img}@anchor{197} @section Attribute Img @@ -10953,7 +10983,7 @@ that returns the appropriate string when called. This means that in an instantiation as a function parameter. @node Attribute Initialized,Attribute Integer_Value,Attribute Img,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-initialized}@anchor{195} +@anchor{gnat_rm/implementation_defined_attributes attribute-initialized}@anchor{198} @section Attribute Initialized @@ -10963,7 +10993,7 @@ For the syntax and semantics of this attribute, see the SPARK 2014 Reference Manual, section 6.10. @node Attribute Integer_Value,Attribute Invalid_Value,Attribute Initialized,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-integer-value}@anchor{196} +@anchor{gnat_rm/implementation_defined_attributes attribute-integer-value}@anchor{199} @section Attribute Integer_Value @@ -10991,7 +11021,7 @@ This attribute is primarily intended for use in implementation of the standard input-output functions for fixed-point values. @node Attribute Invalid_Value,Attribute Large,Attribute Integer_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-invalid-value}@anchor{197} +@anchor{gnat_rm/implementation_defined_attributes attribute-invalid-value}@anchor{19a} @section Attribute Invalid_Value @@ -11005,7 +11035,7 @@ including the ability to modify the value with the binder -Sxx flag and relevant environment variables at run time. @node Attribute Large,Attribute Library_Level,Attribute Invalid_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-large}@anchor{198} +@anchor{gnat_rm/implementation_defined_attributes attribute-large}@anchor{19b} @section Attribute Large @@ -11018,7 +11048,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Library_Level,Attribute Loop_Entry,Attribute Large,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-library-level}@anchor{199} +@anchor{gnat_rm/implementation_defined_attributes attribute-library-level}@anchor{19c} @section Attribute Library_Level @@ -11044,7 +11074,7 @@ end Gen; @end example @node Attribute Loop_Entry,Attribute Machine_Size,Attribute Library_Level,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-loop-entry}@anchor{19a} +@anchor{gnat_rm/implementation_defined_attributes attribute-loop-entry}@anchor{19d} @section Attribute Loop_Entry @@ -11077,7 +11107,7 @@ entry. This copy is not performed if the loop is not entered, or if the corresponding pragmas are ignored or disabled. @node Attribute Machine_Size,Attribute Mantissa,Attribute Loop_Entry,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-machine-size}@anchor{19b} +@anchor{gnat_rm/implementation_defined_attributes attribute-machine-size}@anchor{19e} @section Attribute Machine_Size @@ -11087,7 +11117,7 @@ This attribute is identical to the @code{Object_Size} attribute. It is provided for compatibility with the DEC Ada 83 attribute of this name. @node Attribute Mantissa,Attribute Maximum_Alignment,Attribute Machine_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-mantissa}@anchor{19c} +@anchor{gnat_rm/implementation_defined_attributes attribute-mantissa}@anchor{19f} @section Attribute Mantissa @@ -11100,7 +11130,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Maximum_Alignment,Attribute Max_Integer_Size,Attribute Mantissa,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-maximum-alignment}@anchor{19d}@anchor{gnat_rm/implementation_defined_attributes id2}@anchor{19e} +@anchor{gnat_rm/implementation_defined_attributes attribute-maximum-alignment}@anchor{1a0}@anchor{gnat_rm/implementation_defined_attributes id2}@anchor{1a1} @section Attribute Maximum_Alignment @@ -11116,7 +11146,7 @@ for an object, guaranteeing that it is properly aligned in all cases. @node Attribute Max_Integer_Size,Attribute Mechanism_Code,Attribute Maximum_Alignment,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-max-integer-size}@anchor{19f} +@anchor{gnat_rm/implementation_defined_attributes attribute-max-integer-size}@anchor{1a2} @section Attribute Max_Integer_Size @@ -11127,7 +11157,7 @@ prefix) provides the size of the largest supported integer type for the target. The result is a static constant. @node Attribute Mechanism_Code,Attribute Null_Parameter,Attribute Max_Integer_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-mechanism-code}@anchor{1a0} +@anchor{gnat_rm/implementation_defined_attributes attribute-mechanism-code}@anchor{1a3} @section Attribute Mechanism_Code @@ -11158,7 +11188,7 @@ by reference @end table @node Attribute Null_Parameter,Attribute Object_Size,Attribute Mechanism_Code,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-null-parameter}@anchor{1a1} +@anchor{gnat_rm/implementation_defined_attributes attribute-null-parameter}@anchor{1a4} @section Attribute Null_Parameter @@ -11183,7 +11213,7 @@ There is no way of indicating this without the @code{Null_Parameter} attribute. @node Attribute Object_Size,Attribute Old,Attribute Null_Parameter,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-object-size}@anchor{150}@anchor{gnat_rm/implementation_defined_attributes id3}@anchor{1a2} +@anchor{gnat_rm/implementation_defined_attributes attribute-object-size}@anchor{153}@anchor{gnat_rm/implementation_defined_attributes id3}@anchor{1a5} @section Attribute Object_Size @@ -11253,7 +11283,7 @@ Similar additional checks are performed in other contexts requiring statically matching subtypes. @node Attribute Old,Attribute Passed_By_Reference,Attribute Object_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-old}@anchor{1a3} +@anchor{gnat_rm/implementation_defined_attributes attribute-old}@anchor{1a6} @section Attribute Old @@ -11268,7 +11298,7 @@ definition are allowed under control of implementation defined pragma @code{Unevaluated_Use_Of_Old}. @node Attribute Passed_By_Reference,Attribute Pool_Address,Attribute Old,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-passed-by-reference}@anchor{1a4} +@anchor{gnat_rm/implementation_defined_attributes attribute-passed-by-reference}@anchor{1a7} @section Attribute Passed_By_Reference @@ -11284,7 +11314,7 @@ passed by copy in calls. For scalar types, the result is always @code{False} and is static. For non-scalar types, the result is nonstatic. @node Attribute Pool_Address,Attribute Range_Length,Attribute Passed_By_Reference,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-pool-address}@anchor{1a5} +@anchor{gnat_rm/implementation_defined_attributes attribute-pool-address}@anchor{1a8} @section Attribute Pool_Address @@ -11306,7 +11336,7 @@ For an object created by @code{new}, @code{Ptr.all'Pool_Address} is what is passed to @code{Allocate} and returned from @code{Deallocate}. @node Attribute Range_Length,Attribute Restriction_Set,Attribute Pool_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-range-length}@anchor{1a6} +@anchor{gnat_rm/implementation_defined_attributes attribute-range-length}@anchor{1a9} @section Attribute Range_Length @@ -11319,7 +11349,7 @@ applied to the index subtype of a one dimensional array always gives the same result as @code{Length} applied to the array itself. @node Attribute Restriction_Set,Attribute Result,Attribute Range_Length,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-restriction-set}@anchor{1a7} +@anchor{gnat_rm/implementation_defined_attributes attribute-restriction-set}@anchor{1aa} @section Attribute Restriction_Set @@ -11389,7 +11419,7 @@ Restrictions pragma, they are not analyzed semantically, so they do not have a type. @node Attribute Result,Attribute Round,Attribute Restriction_Set,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-result}@anchor{1a8} +@anchor{gnat_rm/implementation_defined_attributes attribute-result}@anchor{1ab} @section Attribute Result @@ -11402,7 +11432,7 @@ For a further discussion of the use of this attribute and examples of its use, see the description of pragma Postcondition. @node Attribute Round,Attribute Safe_Emax,Attribute Result,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-round}@anchor{1a9} +@anchor{gnat_rm/implementation_defined_attributes attribute-round}@anchor{1ac} @section Attribute Round @@ -11413,7 +11443,7 @@ also permits the use of the @code{'Round} attribute for ordinary fixed point types. @node Attribute Safe_Emax,Attribute Safe_Large,Attribute Round,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-emax}@anchor{1aa} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-emax}@anchor{1ad} @section Attribute Safe_Emax @@ -11426,7 +11456,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Safe_Large,Attribute Safe_Small,Attribute Safe_Emax,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-large}@anchor{1ab} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-large}@anchor{1ae} @section Attribute Safe_Large @@ -11439,7 +11469,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Safe_Small,Attribute Scalar_Storage_Order,Attribute Safe_Large,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-small}@anchor{1ac} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-small}@anchor{1af} @section Attribute Safe_Small @@ -11452,7 +11482,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Scalar_Storage_Order,Attribute Simple_Storage_Pool,Attribute Safe_Small,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-scalar-storage-order}@anchor{15d}@anchor{gnat_rm/implementation_defined_attributes id4}@anchor{1ad} +@anchor{gnat_rm/implementation_defined_attributes attribute-scalar-storage-order}@anchor{160}@anchor{gnat_rm/implementation_defined_attributes id4}@anchor{1b0} @section Attribute Scalar_Storage_Order @@ -11615,7 +11645,7 @@ Note that debuggers may be unable to display the correct value of scalar components of a type for which the opposite storage order is specified. @node Attribute Simple_Storage_Pool,Attribute Small,Attribute Scalar_Storage_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-simple-storage-pool}@anchor{ed}@anchor{gnat_rm/implementation_defined_attributes id5}@anchor{1ae} +@anchor{gnat_rm/implementation_defined_attributes attribute-simple-storage-pool}@anchor{ef}@anchor{gnat_rm/implementation_defined_attributes id5}@anchor{1b1} @section Attribute Simple_Storage_Pool @@ -11678,7 +11708,7 @@ as defined in section 13.11.2 of the Ada Reference Manual, except that the term `simple storage pool' is substituted for `storage pool'. @node Attribute Small,Attribute Small_Denominator,Attribute Simple_Storage_Pool,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-small}@anchor{1af} +@anchor{gnat_rm/implementation_defined_attributes attribute-small}@anchor{1b2} @section Attribute Small @@ -11694,7 +11724,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute when applied to floating-point types. @node Attribute Small_Denominator,Attribute Small_Numerator,Attribute Small,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-small-denominator}@anchor{1b0} +@anchor{gnat_rm/implementation_defined_attributes attribute-small-denominator}@anchor{1b3} @section Attribute Small_Denominator @@ -11707,7 +11737,7 @@ denominator in the representation of @code{typ'Small} as a rational number with coprime factors (i.e. as an irreducible fraction). @node Attribute Small_Numerator,Attribute Storage_Unit,Attribute Small_Denominator,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-small-numerator}@anchor{1b1} +@anchor{gnat_rm/implementation_defined_attributes attribute-small-numerator}@anchor{1b4} @section Attribute Small_Numerator @@ -11720,7 +11750,7 @@ numerator in the representation of @code{typ'Small} as a rational number with coprime factors (i.e. as an irreducible fraction). @node Attribute Storage_Unit,Attribute Stub_Type,Attribute Small_Numerator,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-storage-unit}@anchor{1b2} +@anchor{gnat_rm/implementation_defined_attributes attribute-storage-unit}@anchor{1b5} @section Attribute Storage_Unit @@ -11730,7 +11760,7 @@ with coprime factors (i.e. as an irreducible fraction). prefix) provides the same value as @code{System.Storage_Unit}. @node Attribute Stub_Type,Attribute System_Allocator_Alignment,Attribute Storage_Unit,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-stub-type}@anchor{1b3} +@anchor{gnat_rm/implementation_defined_attributes attribute-stub-type}@anchor{1b6} @section Attribute Stub_Type @@ -11754,7 +11784,7 @@ unit @code{System.Partition_Interface}. Use of this attribute will create an implicit dependency on this unit. @node Attribute System_Allocator_Alignment,Attribute Target_Name,Attribute Stub_Type,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-system-allocator-alignment}@anchor{1b4} +@anchor{gnat_rm/implementation_defined_attributes attribute-system-allocator-alignment}@anchor{1b7} @section Attribute System_Allocator_Alignment @@ -11771,7 +11801,7 @@ with alignment too large or to enable a realignment circuitry if the alignment request is larger than this value. @node Attribute Target_Name,Attribute To_Address,Attribute System_Allocator_Alignment,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-target-name}@anchor{1b5} +@anchor{gnat_rm/implementation_defined_attributes attribute-target-name}@anchor{1b8} @section Attribute Target_Name @@ -11784,7 +11814,7 @@ standard gcc target name without the terminating slash (for example, GNAT 5.0 on windows yields “i586-pc-mingw32msv”). @node Attribute To_Address,Attribute To_Any,Attribute Target_Name,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-to-address}@anchor{1b6} +@anchor{gnat_rm/implementation_defined_attributes attribute-to-address}@anchor{1b9} @section Attribute To_Address @@ -11807,7 +11837,7 @@ modular manner (e.g., -1 means the same as 16#FFFF_FFFF# on a 32 bits machine). @node Attribute To_Any,Attribute Type_Class,Attribute To_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-to-any}@anchor{1b7} +@anchor{gnat_rm/implementation_defined_attributes attribute-to-any}@anchor{1ba} @section Attribute To_Any @@ -11817,7 +11847,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Type_Class,Attribute Type_Key,Attribute To_Any,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-type-class}@anchor{1b8} +@anchor{gnat_rm/implementation_defined_attributes attribute-type-class}@anchor{1bb} @section Attribute Type_Class @@ -11847,7 +11877,7 @@ applies to all concurrent types. This attribute is designed to be compatible with the DEC Ada 83 attribute of the same name. @node Attribute Type_Key,Attribute TypeCode,Attribute Type_Class,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-type-key}@anchor{1b9} +@anchor{gnat_rm/implementation_defined_attributes attribute-type-key}@anchor{1bc} @section Attribute Type_Key @@ -11859,7 +11889,7 @@ about the type or subtype. This provides improved compatibility with other implementations that support this attribute. @node Attribute TypeCode,Attribute Unconstrained_Array,Attribute Type_Key,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-typecode}@anchor{1ba} +@anchor{gnat_rm/implementation_defined_attributes attribute-typecode}@anchor{1bd} @section Attribute TypeCode @@ -11869,7 +11899,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Unconstrained_Array,Attribute Universal_Literal_String,Attribute TypeCode,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-unconstrained-array}@anchor{1bb} +@anchor{gnat_rm/implementation_defined_attributes attribute-unconstrained-array}@anchor{1be} @section Attribute Unconstrained_Array @@ -11883,7 +11913,7 @@ still static, and yields the result of applying this test to the generic actual. @node Attribute Universal_Literal_String,Attribute Unrestricted_Access,Attribute Unconstrained_Array,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-universal-literal-string}@anchor{1bc} +@anchor{gnat_rm/implementation_defined_attributes attribute-universal-literal-string}@anchor{1bf} @section Attribute Universal_Literal_String @@ -11911,7 +11941,7 @@ end; @end example @node Attribute Unrestricted_Access,Attribute Update,Attribute Universal_Literal_String,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-unrestricted-access}@anchor{1bd} +@anchor{gnat_rm/implementation_defined_attributes attribute-unrestricted-access}@anchor{1c0} @section Attribute Unrestricted_Access @@ -12098,7 +12128,7 @@ In general this is a risky approach. It may appear to “work” but such uses o of GNAT to another, so are best avoided if possible. @node Attribute Update,Attribute Valid_Value,Attribute Unrestricted_Access,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-update}@anchor{1be} +@anchor{gnat_rm/implementation_defined_attributes attribute-update}@anchor{1c1} @section Attribute Update @@ -12179,7 +12209,7 @@ A := A'Update ((1, 2) => 20, (3, 4) => 30); which changes element (1,2) to 20 and (3,4) to 30. @node Attribute Valid_Value,Attribute Valid_Scalars,Attribute Update,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-valid-value}@anchor{1bf} +@anchor{gnat_rm/implementation_defined_attributes attribute-valid-value}@anchor{1c2} @section Attribute Valid_Value @@ -12191,7 +12221,7 @@ a String, and returns Boolean. @code{T'Valid_Value (S)} returns True if and only if @code{T'Value (S)} would not raise Constraint_Error. @node Attribute Valid_Scalars,Attribute VADS_Size,Attribute Valid_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-valid-scalars}@anchor{1c0} +@anchor{gnat_rm/implementation_defined_attributes attribute-valid-scalars}@anchor{1c3} @section Attribute Valid_Scalars @@ -12225,7 +12255,7 @@ write a function with a single use of the attribute, and then call that function from multiple places. @node Attribute VADS_Size,Attribute Value_Size,Attribute Valid_Scalars,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-vads-size}@anchor{1c1} +@anchor{gnat_rm/implementation_defined_attributes attribute-vads-size}@anchor{1c4} @section Attribute VADS_Size @@ -12245,7 +12275,7 @@ gives the result that would be obtained by applying the attribute to the corresponding type. @node Attribute Value_Size,Attribute Wchar_T_Size,Attribute VADS_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-value-size}@anchor{16f}@anchor{gnat_rm/implementation_defined_attributes id6}@anchor{1c2} +@anchor{gnat_rm/implementation_defined_attributes attribute-value-size}@anchor{172}@anchor{gnat_rm/implementation_defined_attributes id6}@anchor{1c5} @section Attribute Value_Size @@ -12259,7 +12289,7 @@ a value of the given subtype. It is the same as @code{type'Size}, but, unlike @code{Size}, may be set for non-first subtypes. @node Attribute Wchar_T_Size,Attribute Word_Size,Attribute Value_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-wchar-t-size}@anchor{1c3} +@anchor{gnat_rm/implementation_defined_attributes attribute-wchar-t-size}@anchor{1c6} @section Attribute Wchar_T_Size @@ -12271,7 +12301,7 @@ primarily for constructing the definition of this type in package @code{Interfaces.C}. The result is a static constant. @node Attribute Word_Size,,Attribute Wchar_T_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-word-size}@anchor{1c4} +@anchor{gnat_rm/implementation_defined_attributes attribute-word-size}@anchor{1c7} @section Attribute Word_Size @@ -12282,7 +12312,7 @@ prefix) provides the value @code{System.Word_Size}. The result is a static constant. @node Standard and Implementation Defined Restrictions,Implementation Advice,Implementation Defined Attributes,Top -@anchor{gnat_rm/standard_and_implementation_defined_restrictions doc}@anchor{1c5}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id1}@anchor{1c6}@anchor{gnat_rm/standard_and_implementation_defined_restrictions standard-and-implementation-defined-restrictions}@anchor{9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions doc}@anchor{1c8}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id1}@anchor{1c9}@anchor{gnat_rm/standard_and_implementation_defined_restrictions standard-and-implementation-defined-restrictions}@anchor{9} @chapter Standard and Implementation Defined Restrictions @@ -12311,7 +12341,7 @@ language defined or GNAT-specific, are listed in the following. @end menu @node Partition-Wide Restrictions,Program Unit Level Restrictions,,Standard and Implementation Defined Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions id2}@anchor{1c7}@anchor{gnat_rm/standard_and_implementation_defined_restrictions partition-wide-restrictions}@anchor{1c8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions id2}@anchor{1ca}@anchor{gnat_rm/standard_and_implementation_defined_restrictions partition-wide-restrictions}@anchor{1cb} @section Partition-Wide Restrictions @@ -12404,7 +12434,7 @@ then all compilation units in the partition must obey the restriction). @end menu @node Immediate_Reclamation,Max_Asynchronous_Select_Nesting,,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions immediate-reclamation}@anchor{1c9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions immediate-reclamation}@anchor{1cc} @subsection Immediate_Reclamation @@ -12416,7 +12446,7 @@ deallocation, any storage reserved at run time for an object is immediately reclaimed when the object no longer exists. @node Max_Asynchronous_Select_Nesting,Max_Entry_Queue_Length,Immediate_Reclamation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-asynchronous-select-nesting}@anchor{1ca} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-asynchronous-select-nesting}@anchor{1cd} @subsection Max_Asynchronous_Select_Nesting @@ -12428,7 +12458,7 @@ detected at compile time. Violations of this restriction with values other than zero cause Storage_Error to be raised. @node Max_Entry_Queue_Length,Max_Protected_Entries,Max_Asynchronous_Select_Nesting,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-entry-queue-length}@anchor{1cb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-entry-queue-length}@anchor{1ce} @subsection Max_Entry_Queue_Length @@ -12449,7 +12479,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node Max_Protected_Entries,Max_Select_Alternatives,Max_Entry_Queue_Length,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-protected-entries}@anchor{1cc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-protected-entries}@anchor{1cf} @subsection Max_Protected_Entries @@ -12460,7 +12490,7 @@ bounds of every entry family of a protected unit shall be static, or shall be defined by a discriminant of a subtype whose corresponding bound is static. @node Max_Select_Alternatives,Max_Storage_At_Blocking,Max_Protected_Entries,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-select-alternatives}@anchor{1cd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-select-alternatives}@anchor{1d0} @subsection Max_Select_Alternatives @@ -12469,7 +12499,7 @@ defined by a discriminant of a subtype whose corresponding bound is static. [RM D.7] Specifies the maximum number of alternatives in a selective accept. @node Max_Storage_At_Blocking,Max_Task_Entries,Max_Select_Alternatives,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-storage-at-blocking}@anchor{1ce} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-storage-at-blocking}@anchor{1d1} @subsection Max_Storage_At_Blocking @@ -12480,7 +12510,7 @@ Storage_Size that can be retained by a blocked task. A violation of this restriction causes Storage_Error to be raised. @node Max_Task_Entries,Max_Tasks,Max_Storage_At_Blocking,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-task-entries}@anchor{1cf} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-task-entries}@anchor{1d2} @subsection Max_Task_Entries @@ -12493,7 +12523,7 @@ defined by a discriminant of a subtype whose corresponding bound is static. @node Max_Tasks,No_Abort_Statements,Max_Task_Entries,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-tasks}@anchor{1d0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-tasks}@anchor{1d3} @subsection Max_Tasks @@ -12506,7 +12536,7 @@ time. Violations of this restriction with values other than zero cause Storage_Error to be raised. @node No_Abort_Statements,No_Access_Parameter_Allocators,Max_Tasks,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-abort-statements}@anchor{1d1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-abort-statements}@anchor{1d4} @subsection No_Abort_Statements @@ -12516,7 +12546,7 @@ Storage_Error to be raised. no calls to Task_Identification.Abort_Task. @node No_Access_Parameter_Allocators,No_Access_Subprograms,No_Abort_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-parameter-allocators}@anchor{1d2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-parameter-allocators}@anchor{1d5} @subsection No_Access_Parameter_Allocators @@ -12527,7 +12557,7 @@ occurrences of an allocator as the actual parameter to an access parameter. @node No_Access_Subprograms,No_Allocators,No_Access_Parameter_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-subprograms}@anchor{1d3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-subprograms}@anchor{1d6} @subsection No_Access_Subprograms @@ -12537,7 +12567,7 @@ parameter. declarations of access-to-subprogram types. @node No_Allocators,No_Anonymous_Allocators,No_Access_Subprograms,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-allocators}@anchor{1d4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-allocators}@anchor{1d7} @subsection No_Allocators @@ -12547,7 +12577,7 @@ declarations of access-to-subprogram types. occurrences of an allocator. @node No_Anonymous_Allocators,No_Asynchronous_Control,No_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-anonymous-allocators}@anchor{1d5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-anonymous-allocators}@anchor{1d8} @subsection No_Anonymous_Allocators @@ -12557,7 +12587,7 @@ occurrences of an allocator. occurrences of an allocator of anonymous access type. @node No_Asynchronous_Control,No_Calendar,No_Anonymous_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-asynchronous-control}@anchor{1d6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-asynchronous-control}@anchor{1d9} @subsection No_Asynchronous_Control @@ -12567,7 +12597,7 @@ occurrences of an allocator of anonymous access type. dependences on the predefined package Asynchronous_Task_Control. @node No_Calendar,No_Coextensions,No_Asynchronous_Control,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-calendar}@anchor{1d7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-calendar}@anchor{1da} @subsection No_Calendar @@ -12577,7 +12607,7 @@ dependences on the predefined package Asynchronous_Task_Control. dependences on package Calendar. @node No_Coextensions,No_Default_Initialization,No_Calendar,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-coextensions}@anchor{1d8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-coextensions}@anchor{1db} @subsection No_Coextensions @@ -12587,7 +12617,7 @@ dependences on package Calendar. coextensions. See 3.10.2. @node No_Default_Initialization,No_Delay,No_Coextensions,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-default-initialization}@anchor{1d9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-default-initialization}@anchor{1dc} @subsection No_Default_Initialization @@ -12604,7 +12634,7 @@ is to prohibit all cases of variables declared without a specific initializer (including the case of OUT scalar parameters). @node No_Delay,No_Dependence,No_Default_Initialization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-delay}@anchor{1da} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-delay}@anchor{1dd} @subsection No_Delay @@ -12614,7 +12644,7 @@ initializer (including the case of OUT scalar parameters). delay statements and no semantic dependences on package Calendar. @node No_Dependence,No_Direct_Boolean_Operators,No_Delay,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dependence}@anchor{1db} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dependence}@anchor{1de} @subsection No_Dependence @@ -12657,7 +12687,7 @@ to support specific constructs of the language. Here are some examples: @end itemize @node No_Direct_Boolean_Operators,No_Dispatch,No_Dependence,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-direct-boolean-operators}@anchor{1dc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-direct-boolean-operators}@anchor{1df} @subsection No_Direct_Boolean_Operators @@ -12670,7 +12700,7 @@ protocol requires the use of short-circuit (and then, or else) forms for all composite boolean operations. @node No_Dispatch,No_Dispatching_Calls,No_Direct_Boolean_Operators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatch}@anchor{1dd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatch}@anchor{1e0} @subsection No_Dispatch @@ -12680,7 +12710,7 @@ composite boolean operations. occurrences of @code{T'Class}, for any (tagged) subtype @code{T}. @node No_Dispatching_Calls,No_Dynamic_Attachment,No_Dispatch,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatching-calls}@anchor{1de} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatching-calls}@anchor{1e1} @subsection No_Dispatching_Calls @@ -12741,7 +12771,7 @@ end Example; @end example @node No_Dynamic_Attachment,No_Dynamic_Priorities,No_Dispatching_Calls,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-attachment}@anchor{1df} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-attachment}@anchor{1e2} @subsection No_Dynamic_Attachment @@ -12760,7 +12790,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node No_Dynamic_Priorities,No_Entry_Calls_In_Elaboration_Code,No_Dynamic_Attachment,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-priorities}@anchor{1e0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-priorities}@anchor{1e3} @subsection No_Dynamic_Priorities @@ -12769,7 +12799,7 @@ warnings on obsolescent features are activated). [RM D.7] There are no semantic dependencies on the package Dynamic_Priorities. @node No_Entry_Calls_In_Elaboration_Code,No_Enumeration_Maps,No_Dynamic_Priorities,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-calls-in-elaboration-code}@anchor{1e1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-calls-in-elaboration-code}@anchor{1e4} @subsection No_Entry_Calls_In_Elaboration_Code @@ -12781,7 +12811,7 @@ restriction, the compiler can assume that no code past an accept statement in a task can be executed at elaboration time. @node No_Enumeration_Maps,No_Exception_Handlers,No_Entry_Calls_In_Elaboration_Code,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-enumeration-maps}@anchor{1e2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-enumeration-maps}@anchor{1e5} @subsection No_Enumeration_Maps @@ -12792,7 +12822,7 @@ enumeration maps are used (that is Image and Value attributes applied to enumeration types). @node No_Exception_Handlers,No_Exception_Propagation,No_Enumeration_Maps,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-handlers}@anchor{1e3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-handlers}@anchor{1e6} @subsection No_Exception_Handlers @@ -12817,7 +12847,7 @@ statement generated by the compiler). The Line parameter when nonzero represents the line number in the source program where the raise occurs. @node No_Exception_Propagation,No_Exception_Registration,No_Exception_Handlers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-propagation}@anchor{1e4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-propagation}@anchor{1e7} @subsection No_Exception_Propagation @@ -12834,7 +12864,7 @@ the package GNAT.Current_Exception is not permitted, and reraise statements (raise with no operand) are not permitted. @node No_Exception_Registration,No_Exceptions,No_Exception_Propagation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-registration}@anchor{1e5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-registration}@anchor{1e8} @subsection No_Exception_Registration @@ -12848,7 +12878,7 @@ code is simplified by omitting the otherwise-required global registration of exceptions when they are declared. @node No_Exceptions,No_Finalization,No_Exception_Registration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exceptions}@anchor{1e6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exceptions}@anchor{1e9} @subsection No_Exceptions @@ -12859,7 +12889,7 @@ raise statements and no exception handlers and also suppresses the generation of language-defined run-time checks. @node No_Finalization,No_Fixed_Point,No_Exceptions,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-finalization}@anchor{1e7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-finalization}@anchor{1ea} @subsection No_Finalization @@ -12900,7 +12930,7 @@ object or a nested component, either declared on the stack or on the heap. The deallocation of a controlled object no longer finalizes its contents. @node No_Fixed_Point,No_Floating_Point,No_Finalization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-fixed-point}@anchor{1e8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-fixed-point}@anchor{1eb} @subsection No_Fixed_Point @@ -12910,7 +12940,7 @@ deallocation of a controlled object no longer finalizes its contents. occurrences of fixed point types and operations. @node No_Floating_Point,No_Implicit_Conditionals,No_Fixed_Point,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-floating-point}@anchor{1e9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-floating-point}@anchor{1ec} @subsection No_Floating_Point @@ -12920,7 +12950,7 @@ occurrences of fixed point types and operations. occurrences of floating point types and operations. @node No_Implicit_Conditionals,No_Implicit_Dynamic_Code,No_Floating_Point,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-conditionals}@anchor{1ea} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-conditionals}@anchor{1ed} @subsection No_Implicit_Conditionals @@ -12936,7 +12966,7 @@ normal manner. Constructs generating implicit conditionals include comparisons of composite objects and the Max/Min attributes. @node No_Implicit_Dynamic_Code,No_Implicit_Heap_Allocations,No_Implicit_Conditionals,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-dynamic-code}@anchor{1eb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-dynamic-code}@anchor{1ee} @subsection No_Implicit_Dynamic_Code @@ -12966,7 +12996,7 @@ foreign-language convention; primitive operations of nested tagged types. @node No_Implicit_Heap_Allocations,No_Implicit_Protected_Object_Allocations,No_Implicit_Dynamic_Code,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-heap-allocations}@anchor{1ec} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-heap-allocations}@anchor{1ef} @subsection No_Implicit_Heap_Allocations @@ -12975,7 +13005,7 @@ types. [RM D.7] No constructs are allowed to cause implicit heap allocation. @node No_Implicit_Protected_Object_Allocations,No_Implicit_Task_Allocations,No_Implicit_Heap_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-protected-object-allocations}@anchor{1ed} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-protected-object-allocations}@anchor{1f0} @subsection No_Implicit_Protected_Object_Allocations @@ -12985,7 +13015,7 @@ types. protected object. @node No_Implicit_Task_Allocations,No_Initialize_Scalars,No_Implicit_Protected_Object_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-task-allocations}@anchor{1ee} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-task-allocations}@anchor{1f1} @subsection No_Implicit_Task_Allocations @@ -12994,7 +13024,7 @@ protected object. [GNAT] No constructs are allowed to cause implicit heap allocation of a task. @node No_Initialize_Scalars,No_IO,No_Implicit_Task_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-initialize-scalars}@anchor{1ef} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-initialize-scalars}@anchor{1f2} @subsection No_Initialize_Scalars @@ -13006,7 +13036,7 @@ code, and in particular eliminates dummy null initialization routines that are otherwise generated for some record and array types. @node No_IO,No_Local_Allocators,No_Initialize_Scalars,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-io}@anchor{1f0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-io}@anchor{1f3} @subsection No_IO @@ -13017,7 +13047,7 @@ dependences on any of the library units Sequential_IO, Direct_IO, Text_IO, Wide_Text_IO, Wide_Wide_Text_IO, or Stream_IO. @node No_Local_Allocators,No_Local_Protected_Objects,No_IO,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-allocators}@anchor{1f1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-allocators}@anchor{1f4} @subsection No_Local_Allocators @@ -13028,7 +13058,7 @@ occurrences of an allocator in subprograms, generic subprograms, tasks, and entry bodies. @node No_Local_Protected_Objects,No_Local_Tagged_Types,No_Local_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-protected-objects}@anchor{1f2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-protected-objects}@anchor{1f5} @subsection No_Local_Protected_Objects @@ -13038,7 +13068,7 @@ and entry bodies. only declared at the library level. @node No_Local_Tagged_Types,No_Local_Timing_Events,No_Local_Protected_Objects,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-tagged-types}@anchor{1f3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-tagged-types}@anchor{1f6} @subsection No_Local_Tagged_Types @@ -13048,7 +13078,7 @@ only declared at the library level. declared at the library level. @node No_Local_Timing_Events,No_Long_Long_Integers,No_Local_Tagged_Types,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-timing-events}@anchor{1f4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-timing-events}@anchor{1f7} @subsection No_Local_Timing_Events @@ -13058,7 +13088,7 @@ declared at the library level. declared at the library level. @node No_Long_Long_Integers,No_Multiple_Elaboration,No_Local_Timing_Events,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-long-long-integers}@anchor{1f5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-long-long-integers}@anchor{1f8} @subsection No_Long_Long_Integers @@ -13070,7 +13100,7 @@ implicit base type is Long_Long_Integer, and modular types whose size exceeds Long_Integer’Size. @node No_Multiple_Elaboration,No_Nested_Finalization,No_Long_Long_Integers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-multiple-elaboration}@anchor{1f6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-multiple-elaboration}@anchor{1f9} @subsection No_Multiple_Elaboration @@ -13086,7 +13116,7 @@ possible, including non-Ada main programs and Stand Alone libraries, are not permitted and will be diagnosed by the binder. @node No_Nested_Finalization,No_Protected_Type_Allocators,No_Multiple_Elaboration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-nested-finalization}@anchor{1f7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-nested-finalization}@anchor{1fa} @subsection No_Nested_Finalization @@ -13095,7 +13125,7 @@ permitted and will be diagnosed by the binder. [RM D.7] All objects requiring finalization are declared at the library level. @node No_Protected_Type_Allocators,No_Protected_Types,No_Nested_Finalization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-type-allocators}@anchor{1f8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-type-allocators}@anchor{1fb} @subsection No_Protected_Type_Allocators @@ -13105,7 +13135,7 @@ permitted and will be diagnosed by the binder. expressions that attempt to allocate protected objects. @node No_Protected_Types,No_Recursion,No_Protected_Type_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-types}@anchor{1f9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-types}@anchor{1fc} @subsection No_Protected_Types @@ -13115,7 +13145,7 @@ expressions that attempt to allocate protected objects. declarations of protected types or protected objects. @node No_Recursion,No_Reentrancy,No_Protected_Types,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-recursion}@anchor{1fa} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-recursion}@anchor{1fd} @subsection No_Recursion @@ -13125,7 +13155,7 @@ declarations of protected types or protected objects. part of its execution. @node No_Reentrancy,No_Relative_Delay,No_Recursion,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-reentrancy}@anchor{1fb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-reentrancy}@anchor{1fe} @subsection No_Reentrancy @@ -13135,7 +13165,7 @@ part of its execution. two tasks at the same time. @node No_Relative_Delay,No_Requeue_Statements,No_Reentrancy,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-relative-delay}@anchor{1fc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-relative-delay}@anchor{1ff} @subsection No_Relative_Delay @@ -13146,7 +13176,7 @@ relative statements and prevents expressions such as @code{delay 1.23;} from appearing in source code. @node No_Requeue_Statements,No_Secondary_Stack,No_Relative_Delay,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-requeue-statements}@anchor{1fd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-requeue-statements}@anchor{200} @subsection No_Requeue_Statements @@ -13164,7 +13194,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on oNobsolescent features are activated). @node No_Secondary_Stack,No_Select_Statements,No_Requeue_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-secondary-stack}@anchor{1fe} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-secondary-stack}@anchor{201} @subsection No_Secondary_Stack @@ -13177,7 +13207,7 @@ stack is used to implement functions returning unconstrained objects secondary stacks for tasks (excluding the environment task) at run time. @node No_Select_Statements,No_Specific_Termination_Handlers,No_Secondary_Stack,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-select-statements}@anchor{1ff} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-select-statements}@anchor{202} @subsection No_Select_Statements @@ -13187,7 +13217,7 @@ secondary stacks for tasks (excluding the environment task) at run time. kind are permitted, that is the keyword @code{select} may not appear. @node No_Specific_Termination_Handlers,No_Specification_of_Aspect,No_Select_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specific-termination-handlers}@anchor{200} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specific-termination-handlers}@anchor{203} @subsection No_Specific_Termination_Handlers @@ -13197,7 +13227,7 @@ kind are permitted, that is the keyword @code{select} may not appear. or to Ada.Task_Termination.Specific_Handler. @node No_Specification_of_Aspect,No_Standard_Allocators_After_Elaboration,No_Specific_Termination_Handlers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specification-of-aspect}@anchor{201} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specification-of-aspect}@anchor{204} @subsection No_Specification_of_Aspect @@ -13208,7 +13238,7 @@ specification, attribute definition clause, or pragma is given for a given aspect. @node No_Standard_Allocators_After_Elaboration,No_Standard_Storage_Pools,No_Specification_of_Aspect,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-allocators-after-elaboration}@anchor{202} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-allocators-after-elaboration}@anchor{205} @subsection No_Standard_Allocators_After_Elaboration @@ -13220,7 +13250,7 @@ library items of the partition has completed. Otherwise, Storage_Error is raised. @node No_Standard_Storage_Pools,No_Stream_Optimizations,No_Standard_Allocators_After_Elaboration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-storage-pools}@anchor{203} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-storage-pools}@anchor{206} @subsection No_Standard_Storage_Pools @@ -13232,7 +13262,7 @@ have an explicit Storage_Pool attribute defined specifying a user-defined storage pool. @node No_Stream_Optimizations,No_Streams,No_Standard_Storage_Pools,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-stream-optimizations}@anchor{204} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-stream-optimizations}@anchor{207} @subsection No_Stream_Optimizations @@ -13245,7 +13275,7 @@ due to their superior performance. When this restriction is in effect, the compiler performs all IO operations on a per-character basis. @node No_Streams,No_Tagged_Type_Registration,No_Stream_Optimizations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-streams}@anchor{205} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-streams}@anchor{208} @subsection No_Streams @@ -13272,7 +13302,7 @@ configuration pragmas to avoid exposing entity names at binary level for the entire partition. @node No_Tagged_Type_Registration,No_Task_Allocators,No_Streams,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tagged-type-registration}@anchor{206} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tagged-type-registration}@anchor{209} @subsection No_Tagged_Type_Registration @@ -13287,7 +13317,7 @@ are declared. This restriction may be necessary in order to also apply the No_Elaboration_Code restriction. @node No_Task_Allocators,No_Task_At_Interrupt_Priority,No_Tagged_Type_Registration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-allocators}@anchor{207} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-allocators}@anchor{20a} @subsection No_Task_Allocators @@ -13297,7 +13327,7 @@ the No_Elaboration_Code restriction. or types containing task subcomponents. @node No_Task_At_Interrupt_Priority,No_Task_Attributes_Package,No_Task_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-at-interrupt-priority}@anchor{208} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-at-interrupt-priority}@anchor{20b} @subsection No_Task_At_Interrupt_Priority @@ -13309,7 +13339,7 @@ a consequence, the tasks are always created with a priority below that an interrupt priority. @node No_Task_Attributes_Package,No_Task_Hierarchy,No_Task_At_Interrupt_Priority,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-attributes-package}@anchor{209} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-attributes-package}@anchor{20c} @subsection No_Task_Attributes_Package @@ -13326,7 +13356,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node No_Task_Hierarchy,No_Task_Termination,No_Task_Attributes_Package,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-hierarchy}@anchor{20a} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-hierarchy}@anchor{20d} @subsection No_Task_Hierarchy @@ -13336,7 +13366,7 @@ warnings on obsolescent features are activated). directly on the environment task of the partition. @node No_Task_Termination,No_Tasking,No_Task_Hierarchy,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-termination}@anchor{20b} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-termination}@anchor{20e} @subsection No_Task_Termination @@ -13345,7 +13375,7 @@ directly on the environment task of the partition. [RM D.7] Tasks that terminate are erroneous. @node No_Tasking,No_Terminate_Alternatives,No_Task_Termination,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tasking}@anchor{20c} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tasking}@anchor{20f} @subsection No_Tasking @@ -13358,7 +13388,7 @@ and cause an error message to be output either by the compiler or binder. @node No_Terminate_Alternatives,No_Unchecked_Access,No_Tasking,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-terminate-alternatives}@anchor{20d} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-terminate-alternatives}@anchor{210} @subsection No_Terminate_Alternatives @@ -13367,7 +13397,7 @@ binder. [RM D.7] There are no selective accepts with terminate alternatives. @node No_Unchecked_Access,No_Unchecked_Conversion,No_Terminate_Alternatives,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-access}@anchor{20e} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-access}@anchor{211} @subsection No_Unchecked_Access @@ -13377,7 +13407,7 @@ binder. occurrences of the Unchecked_Access attribute. @node No_Unchecked_Conversion,No_Unchecked_Deallocation,No_Unchecked_Access,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-conversion}@anchor{20f} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-conversion}@anchor{212} @subsection No_Unchecked_Conversion @@ -13387,7 +13417,7 @@ occurrences of the Unchecked_Access attribute. dependences on the predefined generic function Unchecked_Conversion. @node No_Unchecked_Deallocation,No_Use_Of_Attribute,No_Unchecked_Conversion,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-deallocation}@anchor{210} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-deallocation}@anchor{213} @subsection No_Unchecked_Deallocation @@ -13397,7 +13427,7 @@ dependences on the predefined generic function Unchecked_Conversion. dependences on the predefined generic procedure Unchecked_Deallocation. @node No_Use_Of_Attribute,No_Use_Of_Entity,No_Unchecked_Deallocation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-attribute}@anchor{211} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-attribute}@anchor{214} @subsection No_Use_Of_Attribute @@ -13407,7 +13437,7 @@ dependences on the predefined generic procedure Unchecked_Deallocation. earlier versions of Ada. @node No_Use_Of_Entity,No_Use_Of_Pragma,No_Use_Of_Attribute,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-entity}@anchor{212} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-entity}@anchor{215} @subsection No_Use_Of_Entity @@ -13427,7 +13457,7 @@ No_Use_Of_Entity => Ada.Text_IO.Put_Line @end example @node No_Use_Of_Pragma,Pure_Barriers,No_Use_Of_Entity,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-pragma}@anchor{213} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-pragma}@anchor{216} @subsection No_Use_Of_Pragma @@ -13437,7 +13467,7 @@ No_Use_Of_Entity => Ada.Text_IO.Put_Line earlier versions of Ada. @node Pure_Barriers,Simple_Barriers,No_Use_Of_Pragma,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions pure-barriers}@anchor{214} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions pure-barriers}@anchor{217} @subsection Pure_Barriers @@ -13488,7 +13518,7 @@ but still ensures absence of side effects, exceptions, and recursion during the evaluation of the barriers. @node Simple_Barriers,Static_Priorities,Pure_Barriers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions simple-barriers}@anchor{215} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions simple-barriers}@anchor{218} @subsection Simple_Barriers @@ -13507,7 +13537,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node Static_Priorities,Static_Storage_Size,Simple_Barriers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-priorities}@anchor{216} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-priorities}@anchor{219} @subsection Static_Priorities @@ -13518,7 +13548,7 @@ are static, and that there are no dependences on the package @code{Ada.Dynamic_Priorities}. @node Static_Storage_Size,,Static_Priorities,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-storage-size}@anchor{217} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-storage-size}@anchor{21a} @subsection Static_Storage_Size @@ -13528,7 +13558,7 @@ are static, and that there are no dependences on the package in a Storage_Size pragma or attribute definition clause is static. @node Program Unit Level Restrictions,,Partition-Wide Restrictions,Standard and Implementation Defined Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions id3}@anchor{218}@anchor{gnat_rm/standard_and_implementation_defined_restrictions program-unit-level-restrictions}@anchor{219} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions id3}@anchor{21b}@anchor{gnat_rm/standard_and_implementation_defined_restrictions program-unit-level-restrictions}@anchor{21c} @section Program Unit Level Restrictions @@ -13559,7 +13589,7 @@ other compilation units in the partition. @end menu @node No_Elaboration_Code,No_Dynamic_Accessibility_Checks,,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-elaboration-code}@anchor{21a} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-elaboration-code}@anchor{21d} @subsection No_Elaboration_Code @@ -13615,7 +13645,7 @@ associated with the unit. This counter is typically used to check for access before elaboration and to control multiple elaboration attempts. @node No_Dynamic_Accessibility_Checks,No_Dynamic_Sized_Objects,No_Elaboration_Code,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-accessibility-checks}@anchor{21b} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-accessibility-checks}@anchor{21e} @subsection No_Dynamic_Accessibility_Checks @@ -13664,7 +13694,7 @@ In all other cases, the level of T is as defined by the existing rules of Ada. @end itemize @node No_Dynamic_Sized_Objects,No_Entry_Queue,No_Dynamic_Accessibility_Checks,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-sized-objects}@anchor{21c} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-sized-objects}@anchor{21f} @subsection No_Dynamic_Sized_Objects @@ -13682,7 +13712,7 @@ access discriminants. It is often a good idea to combine this restriction with No_Secondary_Stack. @node No_Entry_Queue,No_Implementation_Aspect_Specifications,No_Dynamic_Sized_Objects,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-queue}@anchor{21d} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-queue}@anchor{220} @subsection No_Entry_Queue @@ -13695,7 +13725,7 @@ checked at compile time. A program execution is erroneous if an attempt is made to queue a second task on such an entry. @node No_Implementation_Aspect_Specifications,No_Implementation_Attributes,No_Entry_Queue,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-aspect-specifications}@anchor{21e} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-aspect-specifications}@anchor{221} @subsection No_Implementation_Aspect_Specifications @@ -13706,7 +13736,7 @@ GNAT-defined aspects are present. With this restriction, the only aspects that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Attributes,No_Implementation_Identifiers,No_Implementation_Aspect_Specifications,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-attributes}@anchor{21f} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-attributes}@anchor{222} @subsection No_Implementation_Attributes @@ -13718,7 +13748,7 @@ attributes that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Identifiers,No_Implementation_Pragmas,No_Implementation_Attributes,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-identifiers}@anchor{220} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-identifiers}@anchor{223} @subsection No_Implementation_Identifiers @@ -13729,7 +13759,7 @@ implementation-defined identifiers (marked with pragma Implementation_Defined) occur within language-defined packages. @node No_Implementation_Pragmas,No_Implementation_Restrictions,No_Implementation_Identifiers,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-pragmas}@anchor{221} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-pragmas}@anchor{224} @subsection No_Implementation_Pragmas @@ -13740,7 +13770,7 @@ GNAT-defined pragmas are present. With this restriction, the only pragmas that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Restrictions,No_Implementation_Units,No_Implementation_Pragmas,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-restrictions}@anchor{222} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-restrictions}@anchor{225} @subsection No_Implementation_Restrictions @@ -13752,7 +13782,7 @@ are present. With this restriction, the only other restriction identifiers that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Units,No_Implicit_Aliasing,No_Implementation_Restrictions,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-units}@anchor{223} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-units}@anchor{226} @subsection No_Implementation_Units @@ -13763,7 +13793,7 @@ mention in the context clause of any implementation-defined descendants of packages Ada, Interfaces, or System. @node No_Implicit_Aliasing,No_Implicit_Loops,No_Implementation_Units,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-aliasing}@anchor{224} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-aliasing}@anchor{227} @subsection No_Implicit_Aliasing @@ -13778,7 +13808,7 @@ to be aliased, and in such cases, it can always be replaced by the standard attribute Unchecked_Access which is preferable. @node No_Implicit_Loops,No_Obsolescent_Features,No_Implicit_Aliasing,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-loops}@anchor{225} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-loops}@anchor{228} @subsection No_Implicit_Loops @@ -13795,7 +13825,7 @@ arrays larger than about 5000 scalar components. Note that if this restriction is set in the spec of a package, it will not apply to its body. @node No_Obsolescent_Features,No_Wide_Characters,No_Implicit_Loops,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-obsolescent-features}@anchor{226} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-obsolescent-features}@anchor{229} @subsection No_Obsolescent_Features @@ -13805,7 +13835,7 @@ is set in the spec of a package, it will not apply to its body. features are used, as defined in Annex J of the Ada Reference Manual. @node No_Wide_Characters,Static_Dispatch_Tables,No_Obsolescent_Features,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-wide-characters}@anchor{227} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-wide-characters}@anchor{22a} @subsection No_Wide_Characters @@ -13819,7 +13849,7 @@ appear in the program (that is literals representing characters not in type @code{Character}). @node Static_Dispatch_Tables,SPARK_05,No_Wide_Characters,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-dispatch-tables}@anchor{228} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-dispatch-tables}@anchor{22b} @subsection Static_Dispatch_Tables @@ -13829,7 +13859,7 @@ type @code{Character}). associated with dispatch tables can be placed in read-only memory. @node SPARK_05,,Static_Dispatch_Tables,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions spark-05}@anchor{229} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions spark-05}@anchor{22c} @subsection SPARK_05 @@ -13852,7 +13882,7 @@ gnatprove -P project.gpr --mode=check_all @end example @node Implementation Advice,Implementation Defined Characteristics,Standard and Implementation Defined Restrictions,Top -@anchor{gnat_rm/implementation_advice doc}@anchor{22a}@anchor{gnat_rm/implementation_advice id1}@anchor{22b}@anchor{gnat_rm/implementation_advice implementation-advice}@anchor{a} +@anchor{gnat_rm/implementation_advice doc}@anchor{22d}@anchor{gnat_rm/implementation_advice id1}@anchor{22e}@anchor{gnat_rm/implementation_advice implementation-advice}@anchor{a} @chapter Implementation Advice @@ -13950,7 +13980,7 @@ case the text describes what GNAT does and why. @end menu @node RM 1 1 3 20 Error Detection,RM 1 1 3 31 Child Units,,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-3-20-error-detection}@anchor{22c} +@anchor{gnat_rm/implementation_advice rm-1-1-3-20-error-detection}@anchor{22f} @section RM 1.1.3(20): Error Detection @@ -13967,7 +13997,7 @@ or diagnosed at compile time. @geindex Child Units @node RM 1 1 3 31 Child Units,RM 1 1 5 12 Bounded Errors,RM 1 1 3 20 Error Detection,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-3-31-child-units}@anchor{22d} +@anchor{gnat_rm/implementation_advice rm-1-1-3-31-child-units}@anchor{230} @section RM 1.1.3(31): Child Units @@ -13983,7 +14013,7 @@ Followed. @geindex Bounded errors @node RM 1 1 5 12 Bounded Errors,RM 2 8 16 Pragmas,RM 1 1 3 31 Child Units,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-5-12-bounded-errors}@anchor{22e} +@anchor{gnat_rm/implementation_advice rm-1-1-5-12-bounded-errors}@anchor{231} @section RM 1.1.5(12): Bounded Errors @@ -14000,7 +14030,7 @@ runtime. @geindex Pragmas @node RM 2 8 16 Pragmas,RM 2 8 17-19 Pragmas,RM 1 1 5 12 Bounded Errors,Implementation Advice -@anchor{gnat_rm/implementation_advice id2}@anchor{22f}@anchor{gnat_rm/implementation_advice rm-2-8-16-pragmas}@anchor{230} +@anchor{gnat_rm/implementation_advice id2}@anchor{232}@anchor{gnat_rm/implementation_advice rm-2-8-16-pragmas}@anchor{233} @section RM 2.8(16): Pragmas @@ -14113,7 +14143,7 @@ that this advice not be followed. For details see @ref{7,,Implementation Defined Pragmas}. @node RM 2 8 17-19 Pragmas,RM 3 5 2 5 Alternative Character Sets,RM 2 8 16 Pragmas,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-2-8-17-19-pragmas}@anchor{231} +@anchor{gnat_rm/implementation_advice rm-2-8-17-19-pragmas}@anchor{234} @section RM 2.8(17-19): Pragmas @@ -14134,14 +14164,14 @@ replacing @code{library_items}.” @end itemize @end quotation -See @ref{230,,RM 2.8(16); Pragmas}. +See @ref{233,,RM 2.8(16); Pragmas}. @geindex Character Sets @geindex Alternative Character Sets @node RM 3 5 2 5 Alternative Character Sets,RM 3 5 4 28 Integer Types,RM 2 8 17-19 Pragmas,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-2-5-alternative-character-sets}@anchor{232} +@anchor{gnat_rm/implementation_advice rm-3-5-2-5-alternative-character-sets}@anchor{235} @section RM 3.5.2(5): Alternative Character Sets @@ -14169,7 +14199,7 @@ there is no such restriction. @geindex Integer types @node RM 3 5 4 28 Integer Types,RM 3 5 4 29 Integer Types,RM 3 5 2 5 Alternative Character Sets,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-4-28-integer-types}@anchor{233} +@anchor{gnat_rm/implementation_advice rm-3-5-4-28-integer-types}@anchor{236} @section RM 3.5.4(28): Integer Types @@ -14188,7 +14218,7 @@ are supported for convenient interface to C, and so that all hardware types of the machine are easily available. @node RM 3 5 4 29 Integer Types,RM 3 5 5 8 Enumeration Values,RM 3 5 4 28 Integer Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-4-29-integer-types}@anchor{234} +@anchor{gnat_rm/implementation_advice rm-3-5-4-29-integer-types}@anchor{237} @section RM 3.5.4(29): Integer Types @@ -14204,7 +14234,7 @@ Followed. @geindex Enumeration values @node RM 3 5 5 8 Enumeration Values,RM 3 5 7 17 Float Types,RM 3 5 4 29 Integer Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-5-8-enumeration-values}@anchor{235} +@anchor{gnat_rm/implementation_advice rm-3-5-5-8-enumeration-values}@anchor{238} @section RM 3.5.5(8): Enumeration Values @@ -14224,7 +14254,7 @@ Followed. @geindex Float types @node RM 3 5 7 17 Float Types,RM 3 6 2 11 Multidimensional Arrays,RM 3 5 5 8 Enumeration Values,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-7-17-float-types}@anchor{236} +@anchor{gnat_rm/implementation_advice rm-3-5-7-17-float-types}@anchor{239} @section RM 3.5.7(17): Float Types @@ -14254,7 +14284,7 @@ is a software rather than a hardware format. @geindex multidimensional @node RM 3 6 2 11 Multidimensional Arrays,RM 9 6 30-31 Duration’Small,RM 3 5 7 17 Float Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-6-2-11-multidimensional-arrays}@anchor{237} +@anchor{gnat_rm/implementation_advice rm-3-6-2-11-multidimensional-arrays}@anchor{23a} @section RM 3.6.2(11): Multidimensional Arrays @@ -14272,7 +14302,7 @@ Followed. @geindex Duration'Small @node RM 9 6 30-31 Duration’Small,RM 10 2 1 12 Consistent Representation,RM 3 6 2 11 Multidimensional Arrays,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-9-6-30-31-duration-small}@anchor{238} +@anchor{gnat_rm/implementation_advice rm-9-6-30-31-duration-small}@anchor{23b} @section RM 9.6(30-31): Duration’Small @@ -14293,7 +14323,7 @@ it need not be the same time base as used for @code{Calendar.Clock}.” Followed. @node RM 10 2 1 12 Consistent Representation,RM 11 4 1 19 Exception Information,RM 9 6 30-31 Duration’Small,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-10-2-1-12-consistent-representation}@anchor{239} +@anchor{gnat_rm/implementation_advice rm-10-2-1-12-consistent-representation}@anchor{23c} @section RM 10.2.1(12): Consistent Representation @@ -14315,7 +14345,7 @@ advice without severely impacting efficiency of execution. @geindex Exception information @node RM 11 4 1 19 Exception Information,RM 11 5 28 Suppression of Checks,RM 10 2 1 12 Consistent Representation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-11-4-1-19-exception-information}@anchor{23a} +@anchor{gnat_rm/implementation_advice rm-11-4-1-19-exception-information}@anchor{23d} @section RM 11.4.1(19): Exception Information @@ -14346,7 +14376,7 @@ Pragma @code{Discard_Names}. @geindex suppression of @node RM 11 5 28 Suppression of Checks,RM 13 1 21-24 Representation Clauses,RM 11 4 1 19 Exception Information,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-11-5-28-suppression-of-checks}@anchor{23b} +@anchor{gnat_rm/implementation_advice rm-11-5-28-suppression-of-checks}@anchor{23e} @section RM 11.5(28): Suppression of Checks @@ -14361,7 +14391,7 @@ Followed. @geindex Representation clauses @node RM 13 1 21-24 Representation Clauses,RM 13 2 6-8 Packed Types,RM 11 5 28 Suppression of Checks,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-1-21-24-representation-clauses}@anchor{23c} +@anchor{gnat_rm/implementation_advice rm-13-1-21-24-representation-clauses}@anchor{23f} @section RM 13.1 (21-24): Representation Clauses @@ -14413,7 +14443,7 @@ Followed. @geindex Packed types @node RM 13 2 6-8 Packed Types,RM 13 3 14-19 Address Clauses,RM 13 1 21-24 Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-2-6-8-packed-types}@anchor{23d} +@anchor{gnat_rm/implementation_advice rm-13-2-6-8-packed-types}@anchor{240} @section RM 13.2(6-8): Packed Types @@ -14444,7 +14474,7 @@ subcomponent of the packed type. @geindex Address clauses @node RM 13 3 14-19 Address Clauses,RM 13 3 29-35 Alignment Clauses,RM 13 2 6-8 Packed Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-14-19-address-clauses}@anchor{23e} +@anchor{gnat_rm/implementation_advice rm-13-3-14-19-address-clauses}@anchor{241} @section RM 13.3(14-19): Address Clauses @@ -14497,7 +14527,7 @@ Followed. @geindex Alignment clauses @node RM 13 3 29-35 Alignment Clauses,RM 13 3 42-43 Size Clauses,RM 13 3 14-19 Address Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-29-35-alignment-clauses}@anchor{23f} +@anchor{gnat_rm/implementation_advice rm-13-3-29-35-alignment-clauses}@anchor{242} @section RM 13.3(29-35): Alignment Clauses @@ -14554,7 +14584,7 @@ Followed. @geindex Size clauses @node RM 13 3 42-43 Size Clauses,RM 13 3 50-56 Size Clauses,RM 13 3 29-35 Alignment Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-42-43-size-clauses}@anchor{240} +@anchor{gnat_rm/implementation_advice rm-13-3-42-43-size-clauses}@anchor{243} @section RM 13.3(42-43): Size Clauses @@ -14572,7 +14602,7 @@ object’s @code{Alignment} (if the @code{Alignment} is nonzero).” Followed. @node RM 13 3 50-56 Size Clauses,RM 13 3 71-73 Component Size Clauses,RM 13 3 42-43 Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-50-56-size-clauses}@anchor{241} +@anchor{gnat_rm/implementation_advice rm-13-3-50-56-size-clauses}@anchor{244} @section RM 13.3(50-56): Size Clauses @@ -14623,7 +14653,7 @@ Followed. @geindex Component_Size clauses @node RM 13 3 71-73 Component Size Clauses,RM 13 4 9-10 Enumeration Representation Clauses,RM 13 3 50-56 Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-71-73-component-size-clauses}@anchor{242} +@anchor{gnat_rm/implementation_advice rm-13-3-71-73-component-size-clauses}@anchor{245} @section RM 13.3(71-73): Component Size Clauses @@ -14657,7 +14687,7 @@ Followed. @geindex enumeration @node RM 13 4 9-10 Enumeration Representation Clauses,RM 13 5 1 17-22 Record Representation Clauses,RM 13 3 71-73 Component Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-4-9-10-enumeration-representation-clauses}@anchor{243} +@anchor{gnat_rm/implementation_advice rm-13-4-9-10-enumeration-representation-clauses}@anchor{246} @section RM 13.4(9-10): Enumeration Representation Clauses @@ -14679,7 +14709,7 @@ Followed. @geindex records @node RM 13 5 1 17-22 Record Representation Clauses,RM 13 5 2 5 Storage Place Attributes,RM 13 4 9-10 Enumeration Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-1-17-22-record-representation-clauses}@anchor{244} +@anchor{gnat_rm/implementation_advice rm-13-5-1-17-22-record-representation-clauses}@anchor{247} @section RM 13.5.1(17-22): Record Representation Clauses @@ -14739,7 +14769,7 @@ and all mentioned features are implemented. @geindex Storage place attributes @node RM 13 5 2 5 Storage Place Attributes,RM 13 5 3 7-8 Bit Ordering,RM 13 5 1 17-22 Record Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-2-5-storage-place-attributes}@anchor{245} +@anchor{gnat_rm/implementation_advice rm-13-5-2-5-storage-place-attributes}@anchor{248} @section RM 13.5.2(5): Storage Place Attributes @@ -14759,7 +14789,7 @@ Followed. There are no such components in GNAT. @geindex Bit ordering @node RM 13 5 3 7-8 Bit Ordering,RM 13 7 37 Address as Private,RM 13 5 2 5 Storage Place Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-3-7-8-bit-ordering}@anchor{246} +@anchor{gnat_rm/implementation_advice rm-13-5-3-7-8-bit-ordering}@anchor{249} @section RM 13.5.3(7-8): Bit Ordering @@ -14777,7 +14807,7 @@ Followed. @geindex as private type @node RM 13 7 37 Address as Private,RM 13 7 1 16 Address Operations,RM 13 5 3 7-8 Bit Ordering,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-7-37-address-as-private}@anchor{247} +@anchor{gnat_rm/implementation_advice rm-13-7-37-address-as-private}@anchor{24a} @section RM 13.7(37): Address as Private @@ -14795,7 +14825,7 @@ Followed. @geindex operations of @node RM 13 7 1 16 Address Operations,RM 13 9 14-17 Unchecked Conversion,RM 13 7 37 Address as Private,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-7-1-16-address-operations}@anchor{248} +@anchor{gnat_rm/implementation_advice rm-13-7-1-16-address-operations}@anchor{24b} @section RM 13.7.1(16): Address Operations @@ -14813,7 +14843,7 @@ operation raises @code{Program_Error}, since all operations make sense. @geindex Unchecked conversion @node RM 13 9 14-17 Unchecked Conversion,RM 13 11 23-25 Implicit Heap Usage,RM 13 7 1 16 Address Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-9-14-17-unchecked-conversion}@anchor{249} +@anchor{gnat_rm/implementation_advice rm-13-9-14-17-unchecked-conversion}@anchor{24c} @section RM 13.9(14-17): Unchecked Conversion @@ -14857,7 +14887,7 @@ Followed. @geindex implicit @node RM 13 11 23-25 Implicit Heap Usage,RM 13 11 2 17 Unchecked Deallocation,RM 13 9 14-17 Unchecked Conversion,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-11-23-25-implicit-heap-usage}@anchor{24a} +@anchor{gnat_rm/implementation_advice rm-13-11-23-25-implicit-heap-usage}@anchor{24d} @section RM 13.11(23-25): Implicit Heap Usage @@ -14908,7 +14938,7 @@ Followed. @geindex Unchecked deallocation @node RM 13 11 2 17 Unchecked Deallocation,RM 13 13 2 1 6 Stream Oriented Attributes,RM 13 11 23-25 Implicit Heap Usage,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-11-2-17-unchecked-deallocation}@anchor{24b} +@anchor{gnat_rm/implementation_advice rm-13-11-2-17-unchecked-deallocation}@anchor{24e} @section RM 13.11.2(17): Unchecked Deallocation @@ -14923,7 +14953,7 @@ Followed. @geindex Stream oriented attributes @node RM 13 13 2 1 6 Stream Oriented Attributes,RM A 1 52 Names of Predefined Numeric Types,RM 13 11 2 17 Unchecked Deallocation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-13-2-1-6-stream-oriented-attributes}@anchor{24c} +@anchor{gnat_rm/implementation_advice rm-13-13-2-1-6-stream-oriented-attributes}@anchor{24f} @section RM 13.13.2(1.6): Stream Oriented Attributes @@ -14954,7 +14984,7 @@ scalar types. This XDR alternative can be enabled via the binder switch -xdr. @geindex Stream oriented attributes @node RM A 1 52 Names of Predefined Numeric Types,RM A 3 2 49 Ada Characters Handling,RM 13 13 2 1 6 Stream Oriented Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-1-52-names-of-predefined-numeric-types}@anchor{24d} +@anchor{gnat_rm/implementation_advice rm-a-1-52-names-of-predefined-numeric-types}@anchor{250} @section RM A.1(52): Names of Predefined Numeric Types @@ -14972,7 +15002,7 @@ Followed. @geindex Ada.Characters.Handling @node RM A 3 2 49 Ada Characters Handling,RM A 4 4 106 Bounded-Length String Handling,RM A 1 52 Names of Predefined Numeric Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-3-2-49-ada-characters-handling}@anchor{24e} +@anchor{gnat_rm/implementation_advice rm-a-3-2-49-ada-characters-handling}@anchor{251} @section RM A.3.2(49): @code{Ada.Characters.Handling} @@ -14989,7 +15019,7 @@ Followed. GNAT provides no such localized definitions. @geindex Bounded-length strings @node RM A 4 4 106 Bounded-Length String Handling,RM A 5 2 46-47 Random Number Generation,RM A 3 2 49 Ada Characters Handling,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-4-4-106-bounded-length-string-handling}@anchor{24f} +@anchor{gnat_rm/implementation_advice rm-a-4-4-106-bounded-length-string-handling}@anchor{252} @section RM A.4.4(106): Bounded-Length String Handling @@ -15004,7 +15034,7 @@ Followed. No implicit pointers or dynamic allocation are used. @geindex Random number generation @node RM A 5 2 46-47 Random Number Generation,RM A 10 7 23 Get_Immediate,RM A 4 4 106 Bounded-Length String Handling,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-5-2-46-47-random-number-generation}@anchor{250} +@anchor{gnat_rm/implementation_advice rm-a-5-2-46-47-random-number-generation}@anchor{253} @section RM A.5.2(46-47): Random Number Generation @@ -15033,7 +15063,7 @@ condition here to hold true. @geindex Get_Immediate @node RM A 10 7 23 Get_Immediate,RM A 18 Containers,RM A 5 2 46-47 Random Number Generation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-10-7-23-get-immediate}@anchor{251} +@anchor{gnat_rm/implementation_advice rm-a-10-7-23-get-immediate}@anchor{254} @section RM A.10.7(23): @code{Get_Immediate} @@ -15057,7 +15087,7 @@ this functionality. @geindex Containers @node RM A 18 Containers,RM B 1 39-41 Pragma Export,RM A 10 7 23 Get_Immediate,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-18-containers}@anchor{252} +@anchor{gnat_rm/implementation_advice rm-a-18-containers}@anchor{255} @section RM A.18: @code{Containers} @@ -15078,7 +15108,7 @@ follow the implementation advice. @geindex Export @node RM B 1 39-41 Pragma Export,RM B 2 12-13 Package Interfaces,RM A 18 Containers,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-1-39-41-pragma-export}@anchor{253} +@anchor{gnat_rm/implementation_advice rm-b-1-39-41-pragma-export}@anchor{256} @section RM B.1(39-41): Pragma @code{Export} @@ -15126,7 +15156,7 @@ Followed. @geindex Interfaces @node RM B 2 12-13 Package Interfaces,RM B 3 63-71 Interfacing with C,RM B 1 39-41 Pragma Export,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-2-12-13-package-interfaces}@anchor{254} +@anchor{gnat_rm/implementation_advice rm-b-2-12-13-package-interfaces}@anchor{257} @section RM B.2(12-13): Package @code{Interfaces} @@ -15156,7 +15186,7 @@ Followed. GNAT provides all the packages described in this section. @geindex interfacing with @node RM B 3 63-71 Interfacing with C,RM B 4 95-98 Interfacing with COBOL,RM B 2 12-13 Package Interfaces,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-3-63-71-interfacing-with-c}@anchor{255} +@anchor{gnat_rm/implementation_advice rm-b-3-63-71-interfacing-with-c}@anchor{258} @section RM B.3(63-71): Interfacing with C @@ -15244,7 +15274,7 @@ Followed. @geindex interfacing with @node RM B 4 95-98 Interfacing with COBOL,RM B 5 22-26 Interfacing with Fortran,RM B 3 63-71 Interfacing with C,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-4-95-98-interfacing-with-cobol}@anchor{256} +@anchor{gnat_rm/implementation_advice rm-b-4-95-98-interfacing-with-cobol}@anchor{259} @section RM B.4(95-98): Interfacing with COBOL @@ -15285,7 +15315,7 @@ Followed. @geindex interfacing with @node RM B 5 22-26 Interfacing with Fortran,RM C 1 3-5 Access to Machine Operations,RM B 4 95-98 Interfacing with COBOL,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-5-22-26-interfacing-with-fortran}@anchor{257} +@anchor{gnat_rm/implementation_advice rm-b-5-22-26-interfacing-with-fortran}@anchor{25a} @section RM B.5(22-26): Interfacing with Fortran @@ -15336,7 +15366,7 @@ Followed. @geindex Machine operations @node RM C 1 3-5 Access to Machine Operations,RM C 1 10-16 Access to Machine Operations,RM B 5 22-26 Interfacing with Fortran,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-1-3-5-access-to-machine-operations}@anchor{258} +@anchor{gnat_rm/implementation_advice rm-c-1-3-5-access-to-machine-operations}@anchor{25b} @section RM C.1(3-5): Access to Machine Operations @@ -15371,7 +15401,7 @@ object that is specified as exported.” Followed. @node RM C 1 10-16 Access to Machine Operations,RM C 3 28 Interrupt Support,RM C 1 3-5 Access to Machine Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-1-10-16-access-to-machine-operations}@anchor{259} +@anchor{gnat_rm/implementation_advice rm-c-1-10-16-access-to-machine-operations}@anchor{25c} @section RM C.1(10-16): Access to Machine Operations @@ -15432,7 +15462,7 @@ Followed on any target supporting such operations. @geindex Interrupt support @node RM C 3 28 Interrupt Support,RM C 3 1 20-21 Protected Procedure Handlers,RM C 1 10-16 Access to Machine Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-28-interrupt-support}@anchor{25a} +@anchor{gnat_rm/implementation_advice rm-c-3-28-interrupt-support}@anchor{25d} @section RM C.3(28): Interrupt Support @@ -15450,7 +15480,7 @@ of interrupt blocking. @geindex Protected procedure handlers @node RM C 3 1 20-21 Protected Procedure Handlers,RM C 3 2 25 Package Interrupts,RM C 3 28 Interrupt Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-1-20-21-protected-procedure-handlers}@anchor{25b} +@anchor{gnat_rm/implementation_advice rm-c-3-1-20-21-protected-procedure-handlers}@anchor{25e} @section RM C.3.1(20-21): Protected Procedure Handlers @@ -15476,7 +15506,7 @@ Followed. Compile time warnings are given when possible. @geindex Interrupts @node RM C 3 2 25 Package Interrupts,RM C 4 14 Pre-elaboration Requirements,RM C 3 1 20-21 Protected Procedure Handlers,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-2-25-package-interrupts}@anchor{25c} +@anchor{gnat_rm/implementation_advice rm-c-3-2-25-package-interrupts}@anchor{25f} @section RM C.3.2(25): Package @code{Interrupts} @@ -15494,7 +15524,7 @@ Followed. @geindex Pre-elaboration requirements @node RM C 4 14 Pre-elaboration Requirements,RM C 5 8 Pragma Discard_Names,RM C 3 2 25 Package Interrupts,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-4-14-pre-elaboration-requirements}@anchor{25d} +@anchor{gnat_rm/implementation_advice rm-c-4-14-pre-elaboration-requirements}@anchor{260} @section RM C.4(14): Pre-elaboration Requirements @@ -15510,7 +15540,7 @@ Followed. Executable code is generated in some cases, e.g., loops to initialize large arrays. @node RM C 5 8 Pragma Discard_Names,RM C 7 2 30 The Package Task_Attributes,RM C 4 14 Pre-elaboration Requirements,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-5-8-pragma-discard-names}@anchor{25e} +@anchor{gnat_rm/implementation_advice rm-c-5-8-pragma-discard-names}@anchor{261} @section RM C.5(8): Pragma @code{Discard_Names} @@ -15528,7 +15558,7 @@ Followed. @geindex Task_Attributes @node RM C 7 2 30 The Package Task_Attributes,RM D 3 17 Locking Policies,RM C 5 8 Pragma Discard_Names,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-7-2-30-the-package-task-attributes}@anchor{25f} +@anchor{gnat_rm/implementation_advice rm-c-7-2-30-the-package-task-attributes}@anchor{262} @section RM C.7.2(30): The Package Task_Attributes @@ -15549,7 +15579,7 @@ Not followed. This implementation is not targeted to such a domain. @geindex Locking Policies @node RM D 3 17 Locking Policies,RM D 4 16 Entry Queuing Policies,RM C 7 2 30 The Package Task_Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-3-17-locking-policies}@anchor{260} +@anchor{gnat_rm/implementation_advice rm-d-3-17-locking-policies}@anchor{263} @section RM D.3(17): Locking Policies @@ -15566,7 +15596,7 @@ whose names (@code{Inheritance_Locking} and @geindex Entry queuing policies @node RM D 4 16 Entry Queuing Policies,RM D 6 9-10 Preemptive Abort,RM D 3 17 Locking Policies,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-4-16-entry-queuing-policies}@anchor{261} +@anchor{gnat_rm/implementation_advice rm-d-4-16-entry-queuing-policies}@anchor{264} @section RM D.4(16): Entry Queuing Policies @@ -15581,7 +15611,7 @@ Followed. No such implementation-defined queuing policies exist. @geindex Preemptive abort @node RM D 6 9-10 Preemptive Abort,RM D 7 21 Tasking Restrictions,RM D 4 16 Entry Queuing Policies,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-6-9-10-preemptive-abort}@anchor{262} +@anchor{gnat_rm/implementation_advice rm-d-6-9-10-preemptive-abort}@anchor{265} @section RM D.6(9-10): Preemptive Abort @@ -15607,7 +15637,7 @@ Followed. @geindex Tasking restrictions @node RM D 7 21 Tasking Restrictions,RM D 8 47-49 Monotonic Time,RM D 6 9-10 Preemptive Abort,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-7-21-tasking-restrictions}@anchor{263} +@anchor{gnat_rm/implementation_advice rm-d-7-21-tasking-restrictions}@anchor{266} @section RM D.7(21): Tasking Restrictions @@ -15626,7 +15656,7 @@ pragma @code{Profile (Restricted)} for more details. @geindex monotonic @node RM D 8 47-49 Monotonic Time,RM E 5 28-29 Partition Communication Subsystem,RM D 7 21 Tasking Restrictions,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-8-47-49-monotonic-time}@anchor{264} +@anchor{gnat_rm/implementation_advice rm-d-8-47-49-monotonic-time}@anchor{267} @section RM D.8(47-49): Monotonic Time @@ -15661,7 +15691,7 @@ Followed. @geindex PCS @node RM E 5 28-29 Partition Communication Subsystem,RM F 7 COBOL Support,RM D 8 47-49 Monotonic Time,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-e-5-28-29-partition-communication-subsystem}@anchor{265} +@anchor{gnat_rm/implementation_advice rm-e-5-28-29-partition-communication-subsystem}@anchor{268} @section RM E.5(28-29): Partition Communication Subsystem @@ -15689,7 +15719,7 @@ GNAT. @geindex COBOL support @node RM F 7 COBOL Support,RM F 1 2 Decimal Radix Support,RM E 5 28-29 Partition Communication Subsystem,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-f-7-cobol-support}@anchor{266} +@anchor{gnat_rm/implementation_advice rm-f-7-cobol-support}@anchor{269} @section RM F(7): COBOL Support @@ -15709,7 +15739,7 @@ Followed. @geindex Decimal radix support @node RM F 1 2 Decimal Radix Support,RM G Numerics,RM F 7 COBOL Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-f-1-2-decimal-radix-support}@anchor{267} +@anchor{gnat_rm/implementation_advice rm-f-1-2-decimal-radix-support}@anchor{26a} @section RM F.1(2): Decimal Radix Support @@ -15725,7 +15755,7 @@ representations. @geindex Numerics @node RM G Numerics,RM G 1 1 56-58 Complex Types,RM F 1 2 Decimal Radix Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-numerics}@anchor{268} +@anchor{gnat_rm/implementation_advice rm-g-numerics}@anchor{26b} @section RM G: Numerics @@ -15745,7 +15775,7 @@ Followed. @geindex Complex types @node RM G 1 1 56-58 Complex Types,RM G 1 2 49 Complex Elementary Functions,RM G Numerics,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-1-1-56-58-complex-types}@anchor{269} +@anchor{gnat_rm/implementation_advice rm-g-1-1-56-58-complex-types}@anchor{26c} @section RM G.1.1(56-58): Complex Types @@ -15807,7 +15837,7 @@ Followed. @geindex Complex elementary functions @node RM G 1 2 49 Complex Elementary Functions,RM G 2 4 19 Accuracy Requirements,RM G 1 1 56-58 Complex Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-1-2-49-complex-elementary-functions}@anchor{26a} +@anchor{gnat_rm/implementation_advice rm-g-1-2-49-complex-elementary-functions}@anchor{26d} @section RM G.1.2(49): Complex Elementary Functions @@ -15829,7 +15859,7 @@ Followed. @geindex Accuracy requirements @node RM G 2 4 19 Accuracy Requirements,RM G 2 6 15 Complex Arithmetic Accuracy,RM G 1 2 49 Complex Elementary Functions,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-2-4-19-accuracy-requirements}@anchor{26b} +@anchor{gnat_rm/implementation_advice rm-g-2-4-19-accuracy-requirements}@anchor{26e} @section RM G.2.4(19): Accuracy Requirements @@ -15853,7 +15883,7 @@ Followed. @geindex complex arithmetic @node RM G 2 6 15 Complex Arithmetic Accuracy,RM H 6 15/2 Pragma Partition_Elaboration_Policy,RM G 2 4 19 Accuracy Requirements,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-2-6-15-complex-arithmetic-accuracy}@anchor{26c} +@anchor{gnat_rm/implementation_advice rm-g-2-6-15-complex-arithmetic-accuracy}@anchor{26f} @section RM G.2.6(15): Complex Arithmetic Accuracy @@ -15871,7 +15901,7 @@ Followed. @geindex Sequential elaboration policy @node RM H 6 15/2 Pragma Partition_Elaboration_Policy,,RM G 2 6 15 Complex Arithmetic Accuracy,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-h-6-15-2-pragma-partition-elaboration-policy}@anchor{26d} +@anchor{gnat_rm/implementation_advice rm-h-6-15-2-pragma-partition-elaboration-policy}@anchor{270} @section RM H.6(15/2): Pragma Partition_Elaboration_Policy @@ -15886,7 +15916,7 @@ immediately terminated.” Not followed. @node Implementation Defined Characteristics,Intrinsic Subprograms,Implementation Advice,Top -@anchor{gnat_rm/implementation_defined_characteristics doc}@anchor{26e}@anchor{gnat_rm/implementation_defined_characteristics id1}@anchor{26f}@anchor{gnat_rm/implementation_defined_characteristics implementation-defined-characteristics}@anchor{b} +@anchor{gnat_rm/implementation_defined_characteristics doc}@anchor{271}@anchor{gnat_rm/implementation_defined_characteristics id1}@anchor{272}@anchor{gnat_rm/implementation_defined_characteristics implementation-defined-characteristics}@anchor{b} @chapter Implementation Defined Characteristics @@ -16682,10 +16712,11 @@ via compiler switches such as “-gnata”. @end itemize The implementation defined check names include Alignment_Check, -Atomic_Synchronization, Duplicated_Tag_Check, Container_Checks, -Tampering_Check, Predicate_Check, and Validity_Check. In addition, a user -program can add implementation-defined check names by means of the pragma -Check_Name. See the description of pragma @code{Suppress} for full details. +Atomic_Synchronization, Container_Checks, Duplicated_Tag_Check, +Predicate_Check, Raise_Check, Tampering_Check, and Validity_Check. +In addition, a user program can add implementation-defined check +names by means of the pragma Check_Name. See the description of +pragma @code{Suppress} for full details. @itemize * @@ -16735,7 +16766,7 @@ See separate section on data representations. such aspects and the legality rules for such aspects. See 13.1.1(38).” @end itemize -See @ref{12b,,Implementation Defined Aspects}. +See @ref{12d,,Implementation Defined Aspects}. @itemize * @@ -17179,7 +17210,7 @@ When the @code{Pattern} parameter is not the null string, it is interpreted according to the syntax of regular expressions as defined in the @code{GNAT.Regexp} package. -See @ref{270,,GNAT.Regexp (g-regexp.ads)}. +See @ref{273,,GNAT.Regexp (g-regexp.ads)}. @itemize * @@ -18277,7 +18308,7 @@ Information on those subjects is not yet available. Execution is erroneous in that case. @node Intrinsic Subprograms,Representation Clauses and Pragmas,Implementation Defined Characteristics,Top -@anchor{gnat_rm/intrinsic_subprograms doc}@anchor{271}@anchor{gnat_rm/intrinsic_subprograms id1}@anchor{272}@anchor{gnat_rm/intrinsic_subprograms intrinsic-subprograms}@anchor{c} +@anchor{gnat_rm/intrinsic_subprograms doc}@anchor{274}@anchor{gnat_rm/intrinsic_subprograms id1}@anchor{275}@anchor{gnat_rm/intrinsic_subprograms intrinsic-subprograms}@anchor{c} @chapter Intrinsic Subprograms @@ -18315,7 +18346,7 @@ Ada standard does not require Ada compilers to implement this feature. @end menu @node Intrinsic Operators,Compilation_ISO_Date,,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id2}@anchor{273}@anchor{gnat_rm/intrinsic_subprograms intrinsic-operators}@anchor{274} +@anchor{gnat_rm/intrinsic_subprograms id2}@anchor{276}@anchor{gnat_rm/intrinsic_subprograms intrinsic-operators}@anchor{277} @section Intrinsic Operators @@ -18346,7 +18377,7 @@ It is also possible to specify such operators for private types, if the full views are appropriate arithmetic types. @node Compilation_ISO_Date,Compilation_Date,Intrinsic Operators,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-iso-date}@anchor{275}@anchor{gnat_rm/intrinsic_subprograms id3}@anchor{276} +@anchor{gnat_rm/intrinsic_subprograms compilation-iso-date}@anchor{278}@anchor{gnat_rm/intrinsic_subprograms id3}@anchor{279} @section Compilation_ISO_Date @@ -18360,7 +18391,7 @@ application program should simply call the function the current compilation (in local time format YYYY-MM-DD). @node Compilation_Date,Compilation_Time,Compilation_ISO_Date,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-date}@anchor{277}@anchor{gnat_rm/intrinsic_subprograms id4}@anchor{278} +@anchor{gnat_rm/intrinsic_subprograms compilation-date}@anchor{27a}@anchor{gnat_rm/intrinsic_subprograms id4}@anchor{27b} @section Compilation_Date @@ -18370,7 +18401,7 @@ Same as Compilation_ISO_Date, except the string is in the form MMM DD YYYY. @node Compilation_Time,Enclosing_Entity,Compilation_Date,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-time}@anchor{279}@anchor{gnat_rm/intrinsic_subprograms id5}@anchor{27a} +@anchor{gnat_rm/intrinsic_subprograms compilation-time}@anchor{27c}@anchor{gnat_rm/intrinsic_subprograms id5}@anchor{27d} @section Compilation_Time @@ -18384,7 +18415,7 @@ application program should simply call the function the current compilation (in local time format HH:MM:SS). @node Enclosing_Entity,Exception_Information,Compilation_Time,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms enclosing-entity}@anchor{27b}@anchor{gnat_rm/intrinsic_subprograms id6}@anchor{27c} +@anchor{gnat_rm/intrinsic_subprograms enclosing-entity}@anchor{27e}@anchor{gnat_rm/intrinsic_subprograms id6}@anchor{27f} @section Enclosing_Entity @@ -18398,7 +18429,7 @@ application program should simply call the function the current subprogram, package, task, entry, or protected subprogram. @node Exception_Information,Exception_Message,Enclosing_Entity,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-information}@anchor{27d}@anchor{gnat_rm/intrinsic_subprograms id7}@anchor{27e} +@anchor{gnat_rm/intrinsic_subprograms exception-information}@anchor{280}@anchor{gnat_rm/intrinsic_subprograms id7}@anchor{281} @section Exception_Information @@ -18412,7 +18443,7 @@ so an application program should simply call the function the exception information associated with the current exception. @node Exception_Message,Exception_Name,Exception_Information,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-message}@anchor{27f}@anchor{gnat_rm/intrinsic_subprograms id8}@anchor{280} +@anchor{gnat_rm/intrinsic_subprograms exception-message}@anchor{282}@anchor{gnat_rm/intrinsic_subprograms id8}@anchor{283} @section Exception_Message @@ -18426,7 +18457,7 @@ so an application program should simply call the function the message associated with the current exception. @node Exception_Name,File,Exception_Message,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-name}@anchor{281}@anchor{gnat_rm/intrinsic_subprograms id9}@anchor{282} +@anchor{gnat_rm/intrinsic_subprograms exception-name}@anchor{284}@anchor{gnat_rm/intrinsic_subprograms id9}@anchor{285} @section Exception_Name @@ -18440,7 +18471,7 @@ so an application program should simply call the function the name of the current exception. @node File,Line,Exception_Name,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms file}@anchor{283}@anchor{gnat_rm/intrinsic_subprograms id10}@anchor{284} +@anchor{gnat_rm/intrinsic_subprograms file}@anchor{286}@anchor{gnat_rm/intrinsic_subprograms id10}@anchor{287} @section File @@ -18454,7 +18485,7 @@ application program should simply call the function file. @node Line,Shifts and Rotates,File,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id11}@anchor{285}@anchor{gnat_rm/intrinsic_subprograms line}@anchor{286} +@anchor{gnat_rm/intrinsic_subprograms id11}@anchor{288}@anchor{gnat_rm/intrinsic_subprograms line}@anchor{289} @section Line @@ -18468,7 +18499,7 @@ application program should simply call the function source line. @node Shifts and Rotates,Source_Location,Line,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id12}@anchor{287}@anchor{gnat_rm/intrinsic_subprograms shifts-and-rotates}@anchor{288} +@anchor{gnat_rm/intrinsic_subprograms id12}@anchor{28a}@anchor{gnat_rm/intrinsic_subprograms shifts-and-rotates}@anchor{28b} @section Shifts and Rotates @@ -18511,7 +18542,7 @@ corresponding operator for modular type. In particular, shifting a negative number may change its sign bit to positive. @node Source_Location,,Shifts and Rotates,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id13}@anchor{289}@anchor{gnat_rm/intrinsic_subprograms source-location}@anchor{28a} +@anchor{gnat_rm/intrinsic_subprograms id13}@anchor{28c}@anchor{gnat_rm/intrinsic_subprograms source-location}@anchor{28d} @section Source_Location @@ -18525,7 +18556,7 @@ application program should simply call the function source file location. @node Representation Clauses and Pragmas,Standard Library Routines,Intrinsic Subprograms,Top -@anchor{gnat_rm/representation_clauses_and_pragmas doc}@anchor{28b}@anchor{gnat_rm/representation_clauses_and_pragmas id1}@anchor{28c}@anchor{gnat_rm/representation_clauses_and_pragmas representation-clauses-and-pragmas}@anchor{d} +@anchor{gnat_rm/representation_clauses_and_pragmas doc}@anchor{28e}@anchor{gnat_rm/representation_clauses_and_pragmas id1}@anchor{28f}@anchor{gnat_rm/representation_clauses_and_pragmas representation-clauses-and-pragmas}@anchor{d} @chapter Representation Clauses and Pragmas @@ -18571,7 +18602,7 @@ and this section describes the additional capabilities provided. @end menu @node Alignment Clauses,Size Clauses,,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas alignment-clauses}@anchor{28d}@anchor{gnat_rm/representation_clauses_and_pragmas id2}@anchor{28e} +@anchor{gnat_rm/representation_clauses_and_pragmas alignment-clauses}@anchor{290}@anchor{gnat_rm/representation_clauses_and_pragmas id2}@anchor{291} @section Alignment Clauses @@ -18593,7 +18624,7 @@ For elementary types, the alignment is the minimum of the actual size of objects of the type divided by @code{Storage_Unit}, and the maximum alignment supported by the target. (This maximum alignment is given by the GNAT-specific attribute -@code{Standard'Maximum_Alignment}; see @ref{19d,,Attribute Maximum_Alignment}.) +@code{Standard'Maximum_Alignment}; see @ref{1a0,,Attribute Maximum_Alignment}.) @geindex Maximum_Alignment attribute @@ -18702,7 +18733,7 @@ assumption is non-portable, and other compilers may choose different alignments for the subtype @code{RS}. @node Size Clauses,Storage_Size Clauses,Alignment Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id3}@anchor{28f}@anchor{gnat_rm/representation_clauses_and_pragmas size-clauses}@anchor{290} +@anchor{gnat_rm/representation_clauses_and_pragmas id3}@anchor{292}@anchor{gnat_rm/representation_clauses_and_pragmas size-clauses}@anchor{293} @section Size Clauses @@ -18779,7 +18810,7 @@ if it is known that a Size value can be accommodated in an object of type Integer. @node Storage_Size Clauses,Size of Variant Record Objects,Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id4}@anchor{291}@anchor{gnat_rm/representation_clauses_and_pragmas storage-size-clauses}@anchor{292} +@anchor{gnat_rm/representation_clauses_and_pragmas id4}@anchor{294}@anchor{gnat_rm/representation_clauses_and_pragmas storage-size-clauses}@anchor{295} @section Storage_Size Clauses @@ -18852,7 +18883,7 @@ Of course in practice, there will not be any explicit allocators in the case of such an access declaration. @node Size of Variant Record Objects,Biased Representation,Storage_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id5}@anchor{293}@anchor{gnat_rm/representation_clauses_and_pragmas size-of-variant-record-objects}@anchor{294} +@anchor{gnat_rm/representation_clauses_and_pragmas id5}@anchor{296}@anchor{gnat_rm/representation_clauses_and_pragmas size-of-variant-record-objects}@anchor{297} @section Size of Variant Record Objects @@ -18962,7 +18993,7 @@ the maximum size, regardless of the current variant value, the variant value. @node Biased Representation,Value_Size and Object_Size Clauses,Size of Variant Record Objects,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas biased-representation}@anchor{295}@anchor{gnat_rm/representation_clauses_and_pragmas id6}@anchor{296} +@anchor{gnat_rm/representation_clauses_and_pragmas biased-representation}@anchor{298}@anchor{gnat_rm/representation_clauses_and_pragmas id6}@anchor{299} @section Biased Representation @@ -19000,7 +19031,7 @@ biased representation can be used for all discrete types except for enumeration types for which a representation clause is given. @node Value_Size and Object_Size Clauses,Component_Size Clauses,Biased Representation,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id7}@anchor{297}@anchor{gnat_rm/representation_clauses_and_pragmas value-size-and-object-size-clauses}@anchor{298} +@anchor{gnat_rm/representation_clauses_and_pragmas id7}@anchor{29a}@anchor{gnat_rm/representation_clauses_and_pragmas value-size-and-object-size-clauses}@anchor{29b} @section Value_Size and Object_Size Clauses @@ -19316,7 +19347,7 @@ definition clause forces biased representation. This warning can be turned off using @code{-gnatw.B}. @node Component_Size Clauses,Bit_Order Clauses,Value_Size and Object_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas component-size-clauses}@anchor{299}@anchor{gnat_rm/representation_clauses_and_pragmas id8}@anchor{29a} +@anchor{gnat_rm/representation_clauses_and_pragmas component-size-clauses}@anchor{29c}@anchor{gnat_rm/representation_clauses_and_pragmas id8}@anchor{29d} @section Component_Size Clauses @@ -19364,7 +19395,7 @@ and a pragma Pack for the same array type. if such duplicate clauses are given, the pragma Pack will be ignored. @node Bit_Order Clauses,Effect of Bit_Order on Byte Ordering,Component_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas bit-order-clauses}@anchor{29b}@anchor{gnat_rm/representation_clauses_and_pragmas id9}@anchor{29c} +@anchor{gnat_rm/representation_clauses_and_pragmas bit-order-clauses}@anchor{29e}@anchor{gnat_rm/representation_clauses_and_pragmas id9}@anchor{29f} @section Bit_Order Clauses @@ -19470,7 +19501,7 @@ if desired. The following section contains additional details regarding the issue of byte ordering. @node Effect of Bit_Order on Byte Ordering,Pragma Pack for Arrays,Bit_Order Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-bit-order-on-byte-ordering}@anchor{29d}@anchor{gnat_rm/representation_clauses_and_pragmas id10}@anchor{29e} +@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-bit-order-on-byte-ordering}@anchor{2a0}@anchor{gnat_rm/representation_clauses_and_pragmas id10}@anchor{2a1} @section Effect of Bit_Order on Byte Ordering @@ -19727,7 +19758,7 @@ to set the boolean constant @code{Master_Byte_First} in an appropriate manner. @node Pragma Pack for Arrays,Pragma Pack for Records,Effect of Bit_Order on Byte Ordering,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id11}@anchor{29f}@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-arrays}@anchor{2a0} +@anchor{gnat_rm/representation_clauses_and_pragmas id11}@anchor{2a2}@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-arrays}@anchor{2a3} @section Pragma Pack for Arrays @@ -19847,7 +19878,7 @@ Here 31-bit packing is achieved as required, and no warning is generated, since in this case the programmer intention is clear. @node Pragma Pack for Records,Record Representation Clauses,Pragma Pack for Arrays,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id12}@anchor{2a1}@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-records}@anchor{2a2} +@anchor{gnat_rm/representation_clauses_and_pragmas id12}@anchor{2a4}@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-records}@anchor{2a5} @section Pragma Pack for Records @@ -19931,7 +19962,7 @@ array that is longer than 64 bits, so it is itself non-packable on boundary, and takes an integral number of bytes, i.e., 72 bits. @node Record Representation Clauses,Handling of Records with Holes,Pragma Pack for Records,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id13}@anchor{2a3}@anchor{gnat_rm/representation_clauses_and_pragmas record-representation-clauses}@anchor{2a4} +@anchor{gnat_rm/representation_clauses_and_pragmas id13}@anchor{2a6}@anchor{gnat_rm/representation_clauses_and_pragmas record-representation-clauses}@anchor{2a7} @section Record Representation Clauses @@ -20010,7 +20041,7 @@ end record; @end example @node Handling of Records with Holes,Enumeration Clauses,Record Representation Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas handling-of-records-with-holes}@anchor{2a5}@anchor{gnat_rm/representation_clauses_and_pragmas id14}@anchor{2a6} +@anchor{gnat_rm/representation_clauses_and_pragmas handling-of-records-with-holes}@anchor{2a8}@anchor{gnat_rm/representation_clauses_and_pragmas id14}@anchor{2a9} @section Handling of Records with Holes @@ -20086,7 +20117,7 @@ for Hrec'Size use 64; @end example @node Enumeration Clauses,Address Clauses,Handling of Records with Holes,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas enumeration-clauses}@anchor{2a7}@anchor{gnat_rm/representation_clauses_and_pragmas id15}@anchor{2a8} +@anchor{gnat_rm/representation_clauses_and_pragmas enumeration-clauses}@anchor{2aa}@anchor{gnat_rm/representation_clauses_and_pragmas id15}@anchor{2ab} @section Enumeration Clauses @@ -20129,7 +20160,7 @@ the overhead of converting representation values to the corresponding positional values, (i.e., the value delivered by the @code{Pos} attribute). @node Address Clauses,Use of Address Clauses for Memory-Mapped I/O,Enumeration Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas address-clauses}@anchor{2a9}@anchor{gnat_rm/representation_clauses_and_pragmas id16}@anchor{2aa} +@anchor{gnat_rm/representation_clauses_and_pragmas address-clauses}@anchor{2ac}@anchor{gnat_rm/representation_clauses_and_pragmas id16}@anchor{2ad} @section Address Clauses @@ -20469,7 +20500,7 @@ then the program compiles without the warning and when run will generate the output @code{X was not clobbered}. @node Use of Address Clauses for Memory-Mapped I/O,Effect of Convention on Representation,Address Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id17}@anchor{2ab}@anchor{gnat_rm/representation_clauses_and_pragmas use-of-address-clauses-for-memory-mapped-i-o}@anchor{2ac} +@anchor{gnat_rm/representation_clauses_and_pragmas id17}@anchor{2ae}@anchor{gnat_rm/representation_clauses_and_pragmas use-of-address-clauses-for-memory-mapped-i-o}@anchor{2af} @section Use of Address Clauses for Memory-Mapped I/O @@ -20527,7 +20558,7 @@ provides the pragma @code{Volatile_Full_Access} which can be used in lieu of pragma @code{Atomic} and will give the additional guarantee. @node Effect of Convention on Representation,Conventions and Anonymous Access Types,Use of Address Clauses for Memory-Mapped I/O,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-convention-on-representation}@anchor{2ad}@anchor{gnat_rm/representation_clauses_and_pragmas id18}@anchor{2ae} +@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-convention-on-representation}@anchor{2b0}@anchor{gnat_rm/representation_clauses_and_pragmas id18}@anchor{2b1} @section Effect of Convention on Representation @@ -20605,7 +20636,7 @@ when one of these values is read, any nonzero value is treated as True. @end itemize @node Conventions and Anonymous Access Types,Determining the Representations chosen by GNAT,Effect of Convention on Representation,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas conventions-and-anonymous-access-types}@anchor{2af}@anchor{gnat_rm/representation_clauses_and_pragmas id19}@anchor{2b0} +@anchor{gnat_rm/representation_clauses_and_pragmas conventions-and-anonymous-access-types}@anchor{2b2}@anchor{gnat_rm/representation_clauses_and_pragmas id19}@anchor{2b3} @section Conventions and Anonymous Access Types @@ -20681,7 +20712,7 @@ package ConvComp is @end example @node Determining the Representations chosen by GNAT,,Conventions and Anonymous Access Types,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas determining-the-representations-chosen-by-gnat}@anchor{2b1}@anchor{gnat_rm/representation_clauses_and_pragmas id20}@anchor{2b2} +@anchor{gnat_rm/representation_clauses_and_pragmas determining-the-representations-chosen-by-gnat}@anchor{2b4}@anchor{gnat_rm/representation_clauses_and_pragmas id20}@anchor{2b5} @section Determining the Representations chosen by GNAT @@ -20833,7 +20864,7 @@ generated by the compiler into the original source to fix and guarantee the actual representation to be used. @node Standard Library Routines,The Implementation of Standard I/O,Representation Clauses and Pragmas,Top -@anchor{gnat_rm/standard_library_routines doc}@anchor{2b3}@anchor{gnat_rm/standard_library_routines id1}@anchor{2b4}@anchor{gnat_rm/standard_library_routines standard-library-routines}@anchor{e} +@anchor{gnat_rm/standard_library_routines doc}@anchor{2b6}@anchor{gnat_rm/standard_library_routines id1}@anchor{2b7}@anchor{gnat_rm/standard_library_routines standard-library-routines}@anchor{e} @chapter Standard Library Routines @@ -21659,7 +21690,7 @@ For packages in Interfaces and System, all the RM defined packages are available in GNAT, see the Ada 2012 RM for full details. @node The Implementation of Standard I/O,The GNAT Library,Standard Library Routines,Top -@anchor{gnat_rm/the_implementation_of_standard_i_o doc}@anchor{2b5}@anchor{gnat_rm/the_implementation_of_standard_i_o id1}@anchor{2b6}@anchor{gnat_rm/the_implementation_of_standard_i_o the-implementation-of-standard-i-o}@anchor{f} +@anchor{gnat_rm/the_implementation_of_standard_i_o doc}@anchor{2b8}@anchor{gnat_rm/the_implementation_of_standard_i_o id1}@anchor{2b9}@anchor{gnat_rm/the_implementation_of_standard_i_o the-implementation-of-standard-i-o}@anchor{f} @chapter The Implementation of Standard I/O @@ -21711,7 +21742,7 @@ these additional facilities are also described in this chapter. @end menu @node Standard I/O Packages,FORM Strings,,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id2}@anchor{2b7}@anchor{gnat_rm/the_implementation_of_standard_i_o standard-i-o-packages}@anchor{2b8} +@anchor{gnat_rm/the_implementation_of_standard_i_o id2}@anchor{2ba}@anchor{gnat_rm/the_implementation_of_standard_i_o standard-i-o-packages}@anchor{2bb} @section Standard I/O Packages @@ -21782,7 +21813,7 @@ flush the common I/O streams and in particular Standard_Output before elaborating the Ada code. @node FORM Strings,Direct_IO,Standard I/O Packages,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o form-strings}@anchor{2b9}@anchor{gnat_rm/the_implementation_of_standard_i_o id3}@anchor{2ba} +@anchor{gnat_rm/the_implementation_of_standard_i_o form-strings}@anchor{2bc}@anchor{gnat_rm/the_implementation_of_standard_i_o id3}@anchor{2bd} @section FORM Strings @@ -21808,7 +21839,7 @@ unrecognized keyword appears in a form string, it is silently ignored and not considered invalid. @node Direct_IO,Sequential_IO,FORM Strings,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o direct-io}@anchor{2bb}@anchor{gnat_rm/the_implementation_of_standard_i_o id4}@anchor{2bc} +@anchor{gnat_rm/the_implementation_of_standard_i_o direct-io}@anchor{2be}@anchor{gnat_rm/the_implementation_of_standard_i_o id4}@anchor{2bf} @section Direct_IO @@ -21827,7 +21858,7 @@ There is no limit on the size of Direct_IO files, they are expanded as necessary to accommodate whatever records are written to the file. @node Sequential_IO,Text_IO,Direct_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id5}@anchor{2bd}@anchor{gnat_rm/the_implementation_of_standard_i_o sequential-io}@anchor{2be} +@anchor{gnat_rm/the_implementation_of_standard_i_o id5}@anchor{2c0}@anchor{gnat_rm/the_implementation_of_standard_i_o sequential-io}@anchor{2c1} @section Sequential_IO @@ -21874,7 +21905,7 @@ using Stream_IO, and this is the preferred mechanism. In particular, the above program fragment rewritten to use Stream_IO will work correctly. @node Text_IO,Wide_Text_IO,Sequential_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id6}@anchor{2bf}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io}@anchor{2c0} +@anchor{gnat_rm/the_implementation_of_standard_i_o id6}@anchor{2c2}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io}@anchor{2c3} @section Text_IO @@ -21957,7 +21988,7 @@ the file. @end menu @node Stream Pointer Positioning,Reading and Writing Non-Regular Files,,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id7}@anchor{2c1}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning}@anchor{2c2} +@anchor{gnat_rm/the_implementation_of_standard_i_o id7}@anchor{2c4}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning}@anchor{2c5} @subsection Stream Pointer Positioning @@ -21993,7 +22024,7 @@ between two Ada files, then the difference may be observable in some situations. @node Reading and Writing Non-Regular Files,Get_Immediate,Stream Pointer Positioning,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id8}@anchor{2c3}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files}@anchor{2c4} +@anchor{gnat_rm/the_implementation_of_standard_i_o id8}@anchor{2c6}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files}@anchor{2c7} @subsection Reading and Writing Non-Regular Files @@ -22044,7 +22075,7 @@ to read data past that end of file indication, until another end of file indication is entered. @node Get_Immediate,Treating Text_IO Files as Streams,Reading and Writing Non-Regular Files,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o get-immediate}@anchor{2c5}@anchor{gnat_rm/the_implementation_of_standard_i_o id9}@anchor{2c6} +@anchor{gnat_rm/the_implementation_of_standard_i_o get-immediate}@anchor{2c8}@anchor{gnat_rm/the_implementation_of_standard_i_o id9}@anchor{2c9} @subsection Get_Immediate @@ -22062,7 +22093,7 @@ possible), it is undefined whether the FF character will be treated as a page mark. @node Treating Text_IO Files as Streams,Text_IO Extensions,Get_Immediate,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id10}@anchor{2c7}@anchor{gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams}@anchor{2c8} +@anchor{gnat_rm/the_implementation_of_standard_i_o id10}@anchor{2ca}@anchor{gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams}@anchor{2cb} @subsection Treating Text_IO Files as Streams @@ -22078,7 +22109,7 @@ skipped and the effect is similar to that described above for @code{Get_Immediate}. @node Text_IO Extensions,Text_IO Facilities for Unbounded Strings,Treating Text_IO Files as Streams,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id11}@anchor{2c9}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-extensions}@anchor{2ca} +@anchor{gnat_rm/the_implementation_of_standard_i_o id11}@anchor{2cc}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-extensions}@anchor{2cd} @subsection Text_IO Extensions @@ -22106,7 +22137,7 @@ the string is to be read. @end itemize @node Text_IO Facilities for Unbounded Strings,,Text_IO Extensions,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id12}@anchor{2cb}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-facilities-for-unbounded-strings}@anchor{2cc} +@anchor{gnat_rm/the_implementation_of_standard_i_o id12}@anchor{2ce}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-facilities-for-unbounded-strings}@anchor{2cf} @subsection Text_IO Facilities for Unbounded Strings @@ -22154,7 +22185,7 @@ files @code{a-szuzti.ads} and @code{a-szuzti.adb} provides similar extended @code{Wide_Wide_Text_IO} functionality for unbounded wide wide strings. @node Wide_Text_IO,Wide_Wide_Text_IO,Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id13}@anchor{2cd}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-text-io}@anchor{2ce} +@anchor{gnat_rm/the_implementation_of_standard_i_o id13}@anchor{2d0}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-text-io}@anchor{2d1} @section Wide_Text_IO @@ -22401,12 +22432,12 @@ input also causes Constraint_Error to be raised. @end menu @node Stream Pointer Positioning<2>,Reading and Writing Non-Regular Files<2>,,Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id14}@anchor{2cf}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-1}@anchor{2d0} +@anchor{gnat_rm/the_implementation_of_standard_i_o id14}@anchor{2d2}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-1}@anchor{2d3} @subsection Stream Pointer Positioning @code{Ada.Wide_Text_IO} is similar to @code{Ada.Text_IO} in its handling -of stream pointer positioning (@ref{2c0,,Text_IO}). There is one additional +of stream pointer positioning (@ref{2c3,,Text_IO}). There is one additional case: If @code{Ada.Wide_Text_IO.Look_Ahead} reads a character outside the @@ -22425,7 +22456,7 @@ to a normal program using @code{Wide_Text_IO}. However, this discrepancy can be observed if the wide text file shares a stream with another file. @node Reading and Writing Non-Regular Files<2>,,Stream Pointer Positioning<2>,Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id15}@anchor{2d1}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-1}@anchor{2d2} +@anchor{gnat_rm/the_implementation_of_standard_i_o id15}@anchor{2d4}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-1}@anchor{2d5} @subsection Reading and Writing Non-Regular Files @@ -22436,7 +22467,7 @@ treated as data characters), and @code{End_Of_Page} always returns it is possible to read beyond an end of file. @node Wide_Wide_Text_IO,Stream_IO,Wide_Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id16}@anchor{2d3}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-wide-text-io}@anchor{2d4} +@anchor{gnat_rm/the_implementation_of_standard_i_o id16}@anchor{2d6}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-wide-text-io}@anchor{2d7} @section Wide_Wide_Text_IO @@ -22605,12 +22636,12 @@ input also causes Constraint_Error to be raised. @end menu @node Stream Pointer Positioning<3>,Reading and Writing Non-Regular Files<3>,,Wide_Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id17}@anchor{2d5}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-2}@anchor{2d6} +@anchor{gnat_rm/the_implementation_of_standard_i_o id17}@anchor{2d8}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-2}@anchor{2d9} @subsection Stream Pointer Positioning @code{Ada.Wide_Wide_Text_IO} is similar to @code{Ada.Text_IO} in its handling -of stream pointer positioning (@ref{2c0,,Text_IO}). There is one additional +of stream pointer positioning (@ref{2c3,,Text_IO}). There is one additional case: If @code{Ada.Wide_Wide_Text_IO.Look_Ahead} reads a character outside the @@ -22629,7 +22660,7 @@ to a normal program using @code{Wide_Wide_Text_IO}. However, this discrepancy can be observed if the wide text file shares a stream with another file. @node Reading and Writing Non-Regular Files<3>,,Stream Pointer Positioning<3>,Wide_Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id18}@anchor{2d7}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-2}@anchor{2d8} +@anchor{gnat_rm/the_implementation_of_standard_i_o id18}@anchor{2da}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-2}@anchor{2db} @subsection Reading and Writing Non-Regular Files @@ -22640,7 +22671,7 @@ treated as data characters), and @code{End_Of_Page} always returns it is possible to read beyond an end of file. @node Stream_IO,Text Translation,Wide_Wide_Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id19}@anchor{2d9}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-io}@anchor{2da} +@anchor{gnat_rm/the_implementation_of_standard_i_o id19}@anchor{2dc}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-io}@anchor{2dd} @section Stream_IO @@ -22662,7 +22693,7 @@ manner described for stream attributes. @end itemize @node Text Translation,Shared Files,Stream_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id20}@anchor{2db}@anchor{gnat_rm/the_implementation_of_standard_i_o text-translation}@anchor{2dc} +@anchor{gnat_rm/the_implementation_of_standard_i_o id20}@anchor{2de}@anchor{gnat_rm/the_implementation_of_standard_i_o text-translation}@anchor{2df} @section Text Translation @@ -22696,7 +22727,7 @@ mode. (corresponds to_O_U16TEXT). @end itemize @node Shared Files,Filenames encoding,Text Translation,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id21}@anchor{2dd}@anchor{gnat_rm/the_implementation_of_standard_i_o shared-files}@anchor{2de} +@anchor{gnat_rm/the_implementation_of_standard_i_o id21}@anchor{2e0}@anchor{gnat_rm/the_implementation_of_standard_i_o shared-files}@anchor{2e1} @section Shared Files @@ -22759,7 +22790,7 @@ heterogeneous input-output. Although this approach will work in GNAT if for this purpose (using the stream attributes) @node Filenames encoding,File content encoding,Shared Files,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o filenames-encoding}@anchor{2df}@anchor{gnat_rm/the_implementation_of_standard_i_o id22}@anchor{2e0} +@anchor{gnat_rm/the_implementation_of_standard_i_o filenames-encoding}@anchor{2e2}@anchor{gnat_rm/the_implementation_of_standard_i_o id22}@anchor{2e3} @section Filenames encoding @@ -22799,7 +22830,7 @@ platform. On the other Operating Systems the run-time is supporting UTF-8 natively. @node File content encoding,Open Modes,Filenames encoding,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o file-content-encoding}@anchor{2e1}@anchor{gnat_rm/the_implementation_of_standard_i_o id23}@anchor{2e2} +@anchor{gnat_rm/the_implementation_of_standard_i_o file-content-encoding}@anchor{2e4}@anchor{gnat_rm/the_implementation_of_standard_i_o id23}@anchor{2e5} @section File content encoding @@ -22832,7 +22863,7 @@ Unicode 8-bit encoding This encoding is only supported on the Windows platform. @node Open Modes,Operations on C Streams,File content encoding,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id24}@anchor{2e3}@anchor{gnat_rm/the_implementation_of_standard_i_o open-modes}@anchor{2e4} +@anchor{gnat_rm/the_implementation_of_standard_i_o id24}@anchor{2e6}@anchor{gnat_rm/the_implementation_of_standard_i_o open-modes}@anchor{2e7} @section Open Modes @@ -22935,7 +22966,7 @@ subsequently requires switching from reading to writing or vice-versa, then the file is reopened in @code{r+} mode to permit the required operation. @node Operations on C Streams,Interfacing to C Streams,Open Modes,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id25}@anchor{2e5}@anchor{gnat_rm/the_implementation_of_standard_i_o operations-on-c-streams}@anchor{2e6} +@anchor{gnat_rm/the_implementation_of_standard_i_o id25}@anchor{2e8}@anchor{gnat_rm/the_implementation_of_standard_i_o operations-on-c-streams}@anchor{2e9} @section Operations on C Streams @@ -23095,7 +23126,7 @@ end Interfaces.C_Streams; @end example @node Interfacing to C Streams,,Operations on C Streams,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id26}@anchor{2e7}@anchor{gnat_rm/the_implementation_of_standard_i_o interfacing-to-c-streams}@anchor{2e8} +@anchor{gnat_rm/the_implementation_of_standard_i_o id26}@anchor{2ea}@anchor{gnat_rm/the_implementation_of_standard_i_o interfacing-to-c-streams}@anchor{2eb} @section Interfacing to C Streams @@ -23188,7 +23219,7 @@ imported from a C program, allowing an Ada file to operate on an existing C file. @node The GNAT Library,Interfacing to Other Languages,The Implementation of Standard I/O,Top -@anchor{gnat_rm/the_gnat_library doc}@anchor{2e9}@anchor{gnat_rm/the_gnat_library id1}@anchor{2ea}@anchor{gnat_rm/the_gnat_library the-gnat-library}@anchor{10} +@anchor{gnat_rm/the_gnat_library doc}@anchor{2ec}@anchor{gnat_rm/the_gnat_library id1}@anchor{2ed}@anchor{gnat_rm/the_gnat_library the-gnat-library}@anchor{10} @chapter The GNAT Library @@ -23373,7 +23404,7 @@ of GNAT, and will generate a warning message. @end menu @node Ada Characters Latin_9 a-chlat9 ads,Ada Characters Wide_Latin_1 a-cwila1 ads,,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-latin-9-a-chlat9-ads}@anchor{2eb}@anchor{gnat_rm/the_gnat_library id2}@anchor{2ec} +@anchor{gnat_rm/the_gnat_library ada-characters-latin-9-a-chlat9-ads}@anchor{2ee}@anchor{gnat_rm/the_gnat_library id2}@anchor{2ef} @section @code{Ada.Characters.Latin_9} (@code{a-chlat9.ads}) @@ -23390,7 +23421,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Latin_1 a-cwila1 ads,Ada Characters Wide_Latin_9 a-cwila9 ads,Ada Characters Latin_9 a-chlat9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-1-a-cwila1-ads}@anchor{2ed}@anchor{gnat_rm/the_gnat_library id3}@anchor{2ee} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-1-a-cwila1-ads}@anchor{2f0}@anchor{gnat_rm/the_gnat_library id3}@anchor{2f1} @section @code{Ada.Characters.Wide_Latin_1} (@code{a-cwila1.ads}) @@ -23407,7 +23438,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Latin_9 a-cwila9 ads,Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,Ada Characters Wide_Latin_1 a-cwila1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-9-a-cwila9-ads}@anchor{2ef}@anchor{gnat_rm/the_gnat_library id4}@anchor{2f0} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-9-a-cwila9-ads}@anchor{2f2}@anchor{gnat_rm/the_gnat_library id4}@anchor{2f3} @section @code{Ada.Characters.Wide_Latin_9} (@code{a-cwila9.ads}) @@ -23424,7 +23455,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,Ada Characters Wide_Latin_9 a-cwila9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-1-a-chzla1-ads}@anchor{2f1}@anchor{gnat_rm/the_gnat_library id5}@anchor{2f2} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-1-a-chzla1-ads}@anchor{2f4}@anchor{gnat_rm/the_gnat_library id5}@anchor{2f5} @section @code{Ada.Characters.Wide_Wide_Latin_1} (@code{a-chzla1.ads}) @@ -23441,7 +23472,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,Ada Containers Bounded_Holders a-coboho ads,Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-9-a-chzla9-ads}@anchor{2f3}@anchor{gnat_rm/the_gnat_library id6}@anchor{2f4} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-9-a-chzla9-ads}@anchor{2f6}@anchor{gnat_rm/the_gnat_library id6}@anchor{2f7} @section @code{Ada.Characters.Wide_Wide_Latin_9} (@code{a-chzla9.ads}) @@ -23458,7 +23489,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Containers Bounded_Holders a-coboho ads,Ada Command_Line Environment a-colien ads,Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-containers-bounded-holders-a-coboho-ads}@anchor{2f5}@anchor{gnat_rm/the_gnat_library id7}@anchor{2f6} +@anchor{gnat_rm/the_gnat_library ada-containers-bounded-holders-a-coboho-ads}@anchor{2f8}@anchor{gnat_rm/the_gnat_library id7}@anchor{2f9} @section @code{Ada.Containers.Bounded_Holders} (@code{a-coboho.ads}) @@ -23470,7 +23501,7 @@ This child of @code{Ada.Containers} defines a modified version of Indefinite_Holders that avoids heap allocation. @node Ada Command_Line Environment a-colien ads,Ada Command_Line Remove a-colire ads,Ada Containers Bounded_Holders a-coboho ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-command-line-environment-a-colien-ads}@anchor{2f7}@anchor{gnat_rm/the_gnat_library id8}@anchor{2f8} +@anchor{gnat_rm/the_gnat_library ada-command-line-environment-a-colien-ads}@anchor{2fa}@anchor{gnat_rm/the_gnat_library id8}@anchor{2fb} @section @code{Ada.Command_Line.Environment} (@code{a-colien.ads}) @@ -23483,7 +23514,7 @@ provides a mechanism for obtaining environment values on systems where this concept makes sense. @node Ada Command_Line Remove a-colire ads,Ada Command_Line Response_File a-clrefi ads,Ada Command_Line Environment a-colien ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-command-line-remove-a-colire-ads}@anchor{2f9}@anchor{gnat_rm/the_gnat_library id9}@anchor{2fa} +@anchor{gnat_rm/the_gnat_library ada-command-line-remove-a-colire-ads}@anchor{2fc}@anchor{gnat_rm/the_gnat_library id9}@anchor{2fd} @section @code{Ada.Command_Line.Remove} (@code{a-colire.ads}) @@ -23501,7 +23532,7 @@ to further calls to the subprograms in @code{Ada.Command_Line}. These calls will not see the removed argument. @node Ada Command_Line Response_File a-clrefi ads,Ada Direct_IO C_Streams a-diocst ads,Ada Command_Line Remove a-colire ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-command-line-response-file-a-clrefi-ads}@anchor{2fb}@anchor{gnat_rm/the_gnat_library id10}@anchor{2fc} +@anchor{gnat_rm/the_gnat_library ada-command-line-response-file-a-clrefi-ads}@anchor{2fe}@anchor{gnat_rm/the_gnat_library id10}@anchor{2ff} @section @code{Ada.Command_Line.Response_File} (@code{a-clrefi.ads}) @@ -23521,7 +23552,7 @@ Using a response file allow passing a set of arguments to an executable longer than the maximum allowed by the system on the command line. @node Ada Direct_IO C_Streams a-diocst ads,Ada Exceptions Is_Null_Occurrence a-einuoc ads,Ada Command_Line Response_File a-clrefi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-direct-io-c-streams-a-diocst-ads}@anchor{2fd}@anchor{gnat_rm/the_gnat_library id11}@anchor{2fe} +@anchor{gnat_rm/the_gnat_library ada-direct-io-c-streams-a-diocst-ads}@anchor{300}@anchor{gnat_rm/the_gnat_library id11}@anchor{301} @section @code{Ada.Direct_IO.C_Streams} (@code{a-diocst.ads}) @@ -23536,7 +23567,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Exceptions Is_Null_Occurrence a-einuoc ads,Ada Exceptions Last_Chance_Handler a-elchha ads,Ada Direct_IO C_Streams a-diocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-exceptions-is-null-occurrence-a-einuoc-ads}@anchor{2ff}@anchor{gnat_rm/the_gnat_library id12}@anchor{300} +@anchor{gnat_rm/the_gnat_library ada-exceptions-is-null-occurrence-a-einuoc-ads}@anchor{302}@anchor{gnat_rm/the_gnat_library id12}@anchor{303} @section @code{Ada.Exceptions.Is_Null_Occurrence} (@code{a-einuoc.ads}) @@ -23550,7 +23581,7 @@ exception occurrence (@code{Null_Occurrence}) without raising an exception. @node Ada Exceptions Last_Chance_Handler a-elchha ads,Ada Exceptions Traceback a-exctra ads,Ada Exceptions Is_Null_Occurrence a-einuoc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-exceptions-last-chance-handler-a-elchha-ads}@anchor{301}@anchor{gnat_rm/the_gnat_library id13}@anchor{302} +@anchor{gnat_rm/the_gnat_library ada-exceptions-last-chance-handler-a-elchha-ads}@anchor{304}@anchor{gnat_rm/the_gnat_library id13}@anchor{305} @section @code{Ada.Exceptions.Last_Chance_Handler} (@code{a-elchha.ads}) @@ -23564,7 +23595,7 @@ exceptions (hence the name last chance), and perform clean ups before terminating the program. Note that this subprogram never returns. @node Ada Exceptions Traceback a-exctra ads,Ada Sequential_IO C_Streams a-siocst ads,Ada Exceptions Last_Chance_Handler a-elchha ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-exceptions-traceback-a-exctra-ads}@anchor{303}@anchor{gnat_rm/the_gnat_library id14}@anchor{304} +@anchor{gnat_rm/the_gnat_library ada-exceptions-traceback-a-exctra-ads}@anchor{306}@anchor{gnat_rm/the_gnat_library id14}@anchor{307} @section @code{Ada.Exceptions.Traceback} (@code{a-exctra.ads}) @@ -23577,7 +23608,7 @@ give a traceback array of addresses based on an exception occurrence. @node Ada Sequential_IO C_Streams a-siocst ads,Ada Streams Stream_IO C_Streams a-ssicst ads,Ada Exceptions Traceback a-exctra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-sequential-io-c-streams-a-siocst-ads}@anchor{305}@anchor{gnat_rm/the_gnat_library id15}@anchor{306} +@anchor{gnat_rm/the_gnat_library ada-sequential-io-c-streams-a-siocst-ads}@anchor{308}@anchor{gnat_rm/the_gnat_library id15}@anchor{309} @section @code{Ada.Sequential_IO.C_Streams} (@code{a-siocst.ads}) @@ -23592,7 +23623,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Streams Stream_IO C_Streams a-ssicst ads,Ada Strings Unbounded Text_IO a-suteio ads,Ada Sequential_IO C_Streams a-siocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-streams-stream-io-c-streams-a-ssicst-ads}@anchor{307}@anchor{gnat_rm/the_gnat_library id16}@anchor{308} +@anchor{gnat_rm/the_gnat_library ada-streams-stream-io-c-streams-a-ssicst-ads}@anchor{30a}@anchor{gnat_rm/the_gnat_library id16}@anchor{30b} @section @code{Ada.Streams.Stream_IO.C_Streams} (@code{a-ssicst.ads}) @@ -23607,7 +23638,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Strings Unbounded Text_IO a-suteio ads,Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,Ada Streams Stream_IO C_Streams a-ssicst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-strings-unbounded-text-io-a-suteio-ads}@anchor{309}@anchor{gnat_rm/the_gnat_library id17}@anchor{30a} +@anchor{gnat_rm/the_gnat_library ada-strings-unbounded-text-io-a-suteio-ads}@anchor{30c}@anchor{gnat_rm/the_gnat_library id17}@anchor{30d} @section @code{Ada.Strings.Unbounded.Text_IO} (@code{a-suteio.ads}) @@ -23624,7 +23655,7 @@ strings, avoiding the necessity for an intermediate operation with ordinary strings. @node Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,Ada Strings Unbounded Text_IO a-suteio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-strings-wide-unbounded-wide-text-io-a-swuwti-ads}@anchor{30b}@anchor{gnat_rm/the_gnat_library id18}@anchor{30c} +@anchor{gnat_rm/the_gnat_library ada-strings-wide-unbounded-wide-text-io-a-swuwti-ads}@anchor{30e}@anchor{gnat_rm/the_gnat_library id18}@anchor{30f} @section @code{Ada.Strings.Wide_Unbounded.Wide_Text_IO} (@code{a-swuwti.ads}) @@ -23641,7 +23672,7 @@ wide strings, avoiding the necessity for an intermediate operation with ordinary wide strings. @node Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,Ada Task_Initialization a-tasini ads,Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-strings-wide-wide-unbounded-wide-wide-text-io-a-szuzti-ads}@anchor{30d}@anchor{gnat_rm/the_gnat_library id19}@anchor{30e} +@anchor{gnat_rm/the_gnat_library ada-strings-wide-wide-unbounded-wide-wide-text-io-a-szuzti-ads}@anchor{310}@anchor{gnat_rm/the_gnat_library id19}@anchor{311} @section @code{Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO} (@code{a-szuzti.ads}) @@ -23658,7 +23689,7 @@ wide wide strings, avoiding the necessity for an intermediate operation with ordinary wide wide strings. @node Ada Task_Initialization a-tasini ads,Ada Text_IO C_Streams a-tiocst ads,Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-task-initialization-a-tasini-ads}@anchor{30f}@anchor{gnat_rm/the_gnat_library id20}@anchor{310} +@anchor{gnat_rm/the_gnat_library ada-task-initialization-a-tasini-ads}@anchor{312}@anchor{gnat_rm/the_gnat_library id20}@anchor{313} @section @code{Ada.Task_Initialization} (@code{a-tasini.ads}) @@ -23670,7 +23701,7 @@ parameterless procedures. Note that such a handler is only invoked for those tasks activated after the handler is set. @node Ada Text_IO C_Streams a-tiocst ads,Ada Text_IO Reset_Standard_Files a-tirsfi ads,Ada Task_Initialization a-tasini ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-text-io-c-streams-a-tiocst-ads}@anchor{311}@anchor{gnat_rm/the_gnat_library id21}@anchor{312} +@anchor{gnat_rm/the_gnat_library ada-text-io-c-streams-a-tiocst-ads}@anchor{314}@anchor{gnat_rm/the_gnat_library id21}@anchor{315} @section @code{Ada.Text_IO.C_Streams} (@code{a-tiocst.ads}) @@ -23685,7 +23716,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Text_IO Reset_Standard_Files a-tirsfi ads,Ada Wide_Characters Unicode a-wichun ads,Ada Text_IO C_Streams a-tiocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-text-io-reset-standard-files-a-tirsfi-ads}@anchor{313}@anchor{gnat_rm/the_gnat_library id22}@anchor{314} +@anchor{gnat_rm/the_gnat_library ada-text-io-reset-standard-files-a-tirsfi-ads}@anchor{316}@anchor{gnat_rm/the_gnat_library id22}@anchor{317} @section @code{Ada.Text_IO.Reset_Standard_Files} (@code{a-tirsfi.ads}) @@ -23700,7 +23731,7 @@ execution (for example a standard input file may be redefined to be interactive). @node Ada Wide_Characters Unicode a-wichun ads,Ada Wide_Text_IO C_Streams a-wtcstr ads,Ada Text_IO Reset_Standard_Files a-tirsfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-characters-unicode-a-wichun-ads}@anchor{315}@anchor{gnat_rm/the_gnat_library id23}@anchor{316} +@anchor{gnat_rm/the_gnat_library ada-wide-characters-unicode-a-wichun-ads}@anchor{318}@anchor{gnat_rm/the_gnat_library id23}@anchor{319} @section @code{Ada.Wide_Characters.Unicode} (@code{a-wichun.ads}) @@ -23713,7 +23744,7 @@ This package provides subprograms that allow categorization of Wide_Character values according to Unicode categories. @node Ada Wide_Text_IO C_Streams a-wtcstr ads,Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,Ada Wide_Characters Unicode a-wichun ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-text-io-c-streams-a-wtcstr-ads}@anchor{317}@anchor{gnat_rm/the_gnat_library id24}@anchor{318} +@anchor{gnat_rm/the_gnat_library ada-wide-text-io-c-streams-a-wtcstr-ads}@anchor{31a}@anchor{gnat_rm/the_gnat_library id24}@anchor{31b} @section @code{Ada.Wide_Text_IO.C_Streams} (@code{a-wtcstr.ads}) @@ -23728,7 +23759,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,Ada Wide_Wide_Characters Unicode a-zchuni ads,Ada Wide_Text_IO C_Streams a-wtcstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-text-io-reset-standard-files-a-wrstfi-ads}@anchor{319}@anchor{gnat_rm/the_gnat_library id25}@anchor{31a} +@anchor{gnat_rm/the_gnat_library ada-wide-text-io-reset-standard-files-a-wrstfi-ads}@anchor{31c}@anchor{gnat_rm/the_gnat_library id25}@anchor{31d} @section @code{Ada.Wide_Text_IO.Reset_Standard_Files} (@code{a-wrstfi.ads}) @@ -23743,7 +23774,7 @@ execution (for example a standard input file may be redefined to be interactive). @node Ada Wide_Wide_Characters Unicode a-zchuni ads,Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-wide-characters-unicode-a-zchuni-ads}@anchor{31b}@anchor{gnat_rm/the_gnat_library id26}@anchor{31c} +@anchor{gnat_rm/the_gnat_library ada-wide-wide-characters-unicode-a-zchuni-ads}@anchor{31e}@anchor{gnat_rm/the_gnat_library id26}@anchor{31f} @section @code{Ada.Wide_Wide_Characters.Unicode} (@code{a-zchuni.ads}) @@ -23756,7 +23787,7 @@ This package provides subprograms that allow categorization of Wide_Wide_Character values according to Unicode categories. @node Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,Ada Wide_Wide_Characters Unicode a-zchuni ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-c-streams-a-ztcstr-ads}@anchor{31d}@anchor{gnat_rm/the_gnat_library id27}@anchor{31e} +@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-c-streams-a-ztcstr-ads}@anchor{320}@anchor{gnat_rm/the_gnat_library id27}@anchor{321} @section @code{Ada.Wide_Wide_Text_IO.C_Streams} (@code{a-ztcstr.ads}) @@ -23771,7 +23802,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,GNAT Altivec g-altive ads,Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-reset-standard-files-a-zrstfi-ads}@anchor{31f}@anchor{gnat_rm/the_gnat_library id28}@anchor{320} +@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-reset-standard-files-a-zrstfi-ads}@anchor{322}@anchor{gnat_rm/the_gnat_library id28}@anchor{323} @section @code{Ada.Wide_Wide_Text_IO.Reset_Standard_Files} (@code{a-zrstfi.ads}) @@ -23786,7 +23817,7 @@ change during execution (for example a standard input file may be redefined to be interactive). @node GNAT Altivec g-altive ads,GNAT Altivec Conversions g-altcon ads,Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-g-altive-ads}@anchor{321}@anchor{gnat_rm/the_gnat_library id29}@anchor{322} +@anchor{gnat_rm/the_gnat_library gnat-altivec-g-altive-ads}@anchor{324}@anchor{gnat_rm/the_gnat_library id29}@anchor{325} @section @code{GNAT.Altivec} (@code{g-altive.ads}) @@ -23799,7 +23830,7 @@ definitions of constants and types common to all the versions of the binding. @node GNAT Altivec Conversions g-altcon ads,GNAT Altivec Vector_Operations g-alveop ads,GNAT Altivec g-altive ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-conversions-g-altcon-ads}@anchor{323}@anchor{gnat_rm/the_gnat_library id30}@anchor{324} +@anchor{gnat_rm/the_gnat_library gnat-altivec-conversions-g-altcon-ads}@anchor{326}@anchor{gnat_rm/the_gnat_library id30}@anchor{327} @section @code{GNAT.Altivec.Conversions} (@code{g-altcon.ads}) @@ -23810,7 +23841,7 @@ binding. This package provides the Vector/View conversion routines. @node GNAT Altivec Vector_Operations g-alveop ads,GNAT Altivec Vector_Types g-alvety ads,GNAT Altivec Conversions g-altcon ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-operations-g-alveop-ads}@anchor{325}@anchor{gnat_rm/the_gnat_library id31}@anchor{326} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-operations-g-alveop-ads}@anchor{328}@anchor{gnat_rm/the_gnat_library id31}@anchor{329} @section @code{GNAT.Altivec.Vector_Operations} (@code{g-alveop.ads}) @@ -23824,7 +23855,7 @@ library. The hard binding is provided as a separate package. This unit is common to both bindings. @node GNAT Altivec Vector_Types g-alvety ads,GNAT Altivec Vector_Views g-alvevi ads,GNAT Altivec Vector_Operations g-alveop ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-types-g-alvety-ads}@anchor{327}@anchor{gnat_rm/the_gnat_library id32}@anchor{328} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-types-g-alvety-ads}@anchor{32a}@anchor{gnat_rm/the_gnat_library id32}@anchor{32b} @section @code{GNAT.Altivec.Vector_Types} (@code{g-alvety.ads}) @@ -23836,7 +23867,7 @@ This package exposes the various vector types part of the Ada binding to AltiVec facilities. @node GNAT Altivec Vector_Views g-alvevi ads,GNAT Array_Split g-arrspl ads,GNAT Altivec Vector_Types g-alvety ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-views-g-alvevi-ads}@anchor{329}@anchor{gnat_rm/the_gnat_library id33}@anchor{32a} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-views-g-alvevi-ads}@anchor{32c}@anchor{gnat_rm/the_gnat_library id33}@anchor{32d} @section @code{GNAT.Altivec.Vector_Views} (@code{g-alvevi.ads}) @@ -23851,7 +23882,7 @@ vector elements and provides a simple way to initialize vector objects. @node GNAT Array_Split g-arrspl ads,GNAT AWK g-awk ads,GNAT Altivec Vector_Views g-alvevi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-array-split-g-arrspl-ads}@anchor{32b}@anchor{gnat_rm/the_gnat_library id34}@anchor{32c} +@anchor{gnat_rm/the_gnat_library gnat-array-split-g-arrspl-ads}@anchor{32e}@anchor{gnat_rm/the_gnat_library id34}@anchor{32f} @section @code{GNAT.Array_Split} (@code{g-arrspl.ads}) @@ -23864,7 +23895,7 @@ an array wherever the separators appear, and provide direct access to the resulting slices. @node GNAT AWK g-awk ads,GNAT Binary_Search g-binsea ads,GNAT Array_Split g-arrspl ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-awk-g-awk-ads}@anchor{32d}@anchor{gnat_rm/the_gnat_library id35}@anchor{32e} +@anchor{gnat_rm/the_gnat_library gnat-awk-g-awk-ads}@anchor{330}@anchor{gnat_rm/the_gnat_library id35}@anchor{331} @section @code{GNAT.AWK} (@code{g-awk.ads}) @@ -23879,7 +23910,7 @@ or more files containing formatted data. The file is viewed as a database where each record is a line and a field is a data element in this line. @node GNAT Binary_Search g-binsea ads,GNAT Bind_Environment g-binenv ads,GNAT AWK g-awk ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-binary-search-g-binsea-ads}@anchor{32f}@anchor{gnat_rm/the_gnat_library id36}@anchor{330} +@anchor{gnat_rm/the_gnat_library gnat-binary-search-g-binsea-ads}@anchor{332}@anchor{gnat_rm/the_gnat_library id36}@anchor{333} @section @code{GNAT.Binary_Search} (@code{g-binsea.ads}) @@ -23891,7 +23922,7 @@ Allow binary search of a sorted array (or of an array-like container; the generic does not reference the array directly). @node GNAT Bind_Environment g-binenv ads,GNAT Branch_Prediction g-brapre ads,GNAT Binary_Search g-binsea ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bind-environment-g-binenv-ads}@anchor{331}@anchor{gnat_rm/the_gnat_library id37}@anchor{332} +@anchor{gnat_rm/the_gnat_library gnat-bind-environment-g-binenv-ads}@anchor{334}@anchor{gnat_rm/the_gnat_library id37}@anchor{335} @section @code{GNAT.Bind_Environment} (@code{g-binenv.ads}) @@ -23904,7 +23935,7 @@ These associations can be specified using the @code{-V} binder command line switch. @node GNAT Branch_Prediction g-brapre ads,GNAT Bounded_Buffers g-boubuf ads,GNAT Bind_Environment g-binenv ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-branch-prediction-g-brapre-ads}@anchor{333}@anchor{gnat_rm/the_gnat_library id38}@anchor{334} +@anchor{gnat_rm/the_gnat_library gnat-branch-prediction-g-brapre-ads}@anchor{336}@anchor{gnat_rm/the_gnat_library id38}@anchor{337} @section @code{GNAT.Branch_Prediction} (@code{g-brapre.ads}) @@ -23915,7 +23946,7 @@ line switch. Provides routines giving hints to the branch predictor of the code generator. @node GNAT Bounded_Buffers g-boubuf ads,GNAT Bounded_Mailboxes g-boumai ads,GNAT Branch_Prediction g-brapre ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bounded-buffers-g-boubuf-ads}@anchor{335}@anchor{gnat_rm/the_gnat_library id39}@anchor{336} +@anchor{gnat_rm/the_gnat_library gnat-bounded-buffers-g-boubuf-ads}@anchor{338}@anchor{gnat_rm/the_gnat_library id39}@anchor{339} @section @code{GNAT.Bounded_Buffers} (@code{g-boubuf.ads}) @@ -23930,7 +23961,7 @@ useful directly or as parts of the implementations of other abstractions, such as mailboxes. @node GNAT Bounded_Mailboxes g-boumai ads,GNAT Bubble_Sort g-bubsor ads,GNAT Bounded_Buffers g-boubuf ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bounded-mailboxes-g-boumai-ads}@anchor{337}@anchor{gnat_rm/the_gnat_library id40}@anchor{338} +@anchor{gnat_rm/the_gnat_library gnat-bounded-mailboxes-g-boumai-ads}@anchor{33a}@anchor{gnat_rm/the_gnat_library id40}@anchor{33b} @section @code{GNAT.Bounded_Mailboxes} (@code{g-boumai.ads}) @@ -23943,7 +23974,7 @@ such as mailboxes. Provides a thread-safe asynchronous intertask mailbox communication facility. @node GNAT Bubble_Sort g-bubsor ads,GNAT Bubble_Sort_A g-busora ads,GNAT Bounded_Mailboxes g-boumai ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-bubsor-ads}@anchor{339}@anchor{gnat_rm/the_gnat_library id41}@anchor{33a} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-bubsor-ads}@anchor{33c}@anchor{gnat_rm/the_gnat_library id41}@anchor{33d} @section @code{GNAT.Bubble_Sort} (@code{g-bubsor.ads}) @@ -23958,7 +23989,7 @@ data items. Exchange and comparison procedures are provided by passing access-to-procedure values. @node GNAT Bubble_Sort_A g-busora ads,GNAT Bubble_Sort_G g-busorg ads,GNAT Bubble_Sort g-bubsor ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-a-g-busora-ads}@anchor{33b}@anchor{gnat_rm/the_gnat_library id42}@anchor{33c} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-a-g-busora-ads}@anchor{33e}@anchor{gnat_rm/the_gnat_library id42}@anchor{33f} @section @code{GNAT.Bubble_Sort_A} (@code{g-busora.ads}) @@ -23974,7 +24005,7 @@ access-to-procedure values. This is an older version, retained for compatibility. Usually @code{GNAT.Bubble_Sort} will be preferable. @node GNAT Bubble_Sort_G g-busorg ads,GNAT Byte_Order_Mark g-byorma ads,GNAT Bubble_Sort_A g-busora ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-g-busorg-ads}@anchor{33d}@anchor{gnat_rm/the_gnat_library id43}@anchor{33e} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-g-busorg-ads}@anchor{340}@anchor{gnat_rm/the_gnat_library id43}@anchor{341} @section @code{GNAT.Bubble_Sort_G} (@code{g-busorg.ads}) @@ -23990,7 +24021,7 @@ if the procedures can be inlined, at the expense of duplicating code for multiple instantiations. @node GNAT Byte_Order_Mark g-byorma ads,GNAT Byte_Swapping g-bytswa ads,GNAT Bubble_Sort_G g-busorg ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-byte-order-mark-g-byorma-ads}@anchor{33f}@anchor{gnat_rm/the_gnat_library id44}@anchor{340} +@anchor{gnat_rm/the_gnat_library gnat-byte-order-mark-g-byorma-ads}@anchor{342}@anchor{gnat_rm/the_gnat_library id44}@anchor{343} @section @code{GNAT.Byte_Order_Mark} (@code{g-byorma.ads}) @@ -24006,7 +24037,7 @@ the encoding of the string. The routine includes detection of special XML sequences for various UCS input formats. @node GNAT Byte_Swapping g-bytswa ads,GNAT Calendar g-calend ads,GNAT Byte_Order_Mark g-byorma ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-byte-swapping-g-bytswa-ads}@anchor{341}@anchor{gnat_rm/the_gnat_library id45}@anchor{342} +@anchor{gnat_rm/the_gnat_library gnat-byte-swapping-g-bytswa-ads}@anchor{344}@anchor{gnat_rm/the_gnat_library id45}@anchor{345} @section @code{GNAT.Byte_Swapping} (@code{g-bytswa.ads}) @@ -24020,7 +24051,7 @@ General routines for swapping the bytes in 2-, 4-, and 8-byte quantities. Machine-specific implementations are available in some cases. @node GNAT Calendar g-calend ads,GNAT Calendar Time_IO g-catiio ads,GNAT Byte_Swapping g-bytswa ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{343}@anchor{gnat_rm/the_gnat_library id46}@anchor{344} +@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{346}@anchor{gnat_rm/the_gnat_library id46}@anchor{347} @section @code{GNAT.Calendar} (@code{g-calend.ads}) @@ -24034,7 +24065,7 @@ Also provides conversion of @code{Ada.Calendar.Time} values to and from the C @code{timeval} format. @node GNAT Calendar Time_IO g-catiio ads,GNAT CRC32 g-crc32 ads,GNAT Calendar g-calend ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{345}@anchor{gnat_rm/the_gnat_library id47}@anchor{346} +@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{348}@anchor{gnat_rm/the_gnat_library id47}@anchor{349} @section @code{GNAT.Calendar.Time_IO} (@code{g-catiio.ads}) @@ -24045,7 +24076,7 @@ C @code{timeval} format. @geindex GNAT.Calendar.Time_IO (g-catiio.ads) @node GNAT CRC32 g-crc32 ads,GNAT Case_Util g-casuti ads,GNAT Calendar Time_IO g-catiio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{347}@anchor{gnat_rm/the_gnat_library id48}@anchor{348} +@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{34a}@anchor{gnat_rm/the_gnat_library id48}@anchor{34b} @section @code{GNAT.CRC32} (@code{g-crc32.ads}) @@ -24062,7 +24093,7 @@ of this algorithm see Aug. 1988. Sarwate, D.V. @node GNAT Case_Util g-casuti ads,GNAT CGI g-cgi ads,GNAT CRC32 g-crc32 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{349}@anchor{gnat_rm/the_gnat_library id49}@anchor{34a} +@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{34c}@anchor{gnat_rm/the_gnat_library id49}@anchor{34d} @section @code{GNAT.Case_Util} (@code{g-casuti.ads}) @@ -24077,7 +24108,7 @@ without the overhead of the full casing tables in @code{Ada.Characters.Handling}. @node GNAT CGI g-cgi ads,GNAT CGI Cookie g-cgicoo ads,GNAT Case_Util g-casuti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{34b}@anchor{gnat_rm/the_gnat_library id50}@anchor{34c} +@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{34e}@anchor{gnat_rm/the_gnat_library id50}@anchor{34f} @section @code{GNAT.CGI} (@code{g-cgi.ads}) @@ -24092,7 +24123,7 @@ builds a table whose index is the key and provides some services to deal with this table. @node GNAT CGI Cookie g-cgicoo ads,GNAT CGI Debug g-cgideb ads,GNAT CGI g-cgi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{34d}@anchor{gnat_rm/the_gnat_library id51}@anchor{34e} +@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{350}@anchor{gnat_rm/the_gnat_library id51}@anchor{351} @section @code{GNAT.CGI.Cookie} (@code{g-cgicoo.ads}) @@ -24107,7 +24138,7 @@ Common Gateway Interface (CGI). It exports services to deal with Web cookies (piece of information kept in the Web client software). @node GNAT CGI Debug g-cgideb ads,GNAT Command_Line g-comlin ads,GNAT CGI Cookie g-cgicoo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{34f}@anchor{gnat_rm/the_gnat_library id52}@anchor{350} +@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{352}@anchor{gnat_rm/the_gnat_library id52}@anchor{353} @section @code{GNAT.CGI.Debug} (@code{g-cgideb.ads}) @@ -24119,7 +24150,7 @@ This is a package to help debugging CGI (Common Gateway Interface) programs written in Ada. @node GNAT Command_Line g-comlin ads,GNAT Compiler_Version g-comver ads,GNAT CGI Debug g-cgideb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{351}@anchor{gnat_rm/the_gnat_library id53}@anchor{352} +@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{354}@anchor{gnat_rm/the_gnat_library id53}@anchor{355} @section @code{GNAT.Command_Line} (@code{g-comlin.ads}) @@ -24132,7 +24163,7 @@ including the ability to scan for named switches with optional parameters and expand file names using wildcard notations. @node GNAT Compiler_Version g-comver ads,GNAT Ctrl_C g-ctrl_c ads,GNAT Command_Line g-comlin ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{353}@anchor{gnat_rm/the_gnat_library id54}@anchor{354} +@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{356}@anchor{gnat_rm/the_gnat_library id54}@anchor{357} @section @code{GNAT.Compiler_Version} (@code{g-comver.ads}) @@ -24150,7 +24181,7 @@ of the compiler if a consistent tool set is used to compile all units of a partition). @node GNAT Ctrl_C g-ctrl_c ads,GNAT Current_Exception g-curexc ads,GNAT Compiler_Version g-comver ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{355}@anchor{gnat_rm/the_gnat_library id55}@anchor{356} +@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{358}@anchor{gnat_rm/the_gnat_library id55}@anchor{359} @section @code{GNAT.Ctrl_C} (@code{g-ctrl_c.ads}) @@ -24161,7 +24192,7 @@ of a partition). Provides a simple interface to handle Ctrl-C keyboard events. @node GNAT Current_Exception g-curexc ads,GNAT Debug_Pools g-debpoo ads,GNAT Ctrl_C g-ctrl_c ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{357}@anchor{gnat_rm/the_gnat_library id56}@anchor{358} +@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{35a}@anchor{gnat_rm/the_gnat_library id56}@anchor{35b} @section @code{GNAT.Current_Exception} (@code{g-curexc.ads}) @@ -24178,7 +24209,7 @@ This is particularly useful in simulating typical facilities for obtaining information about exceptions provided by Ada 83 compilers. @node GNAT Debug_Pools g-debpoo ads,GNAT Debug_Utilities g-debuti ads,GNAT Current_Exception g-curexc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{359}@anchor{gnat_rm/the_gnat_library id57}@anchor{35a} +@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{35c}@anchor{gnat_rm/the_gnat_library id57}@anchor{35d} @section @code{GNAT.Debug_Pools} (@code{g-debpoo.ads}) @@ -24195,7 +24226,7 @@ problems. See @code{The GNAT Debug_Pool Facility} section in the @cite{GNAT User’s Guide}. @node GNAT Debug_Utilities g-debuti ads,GNAT Decode_String g-decstr ads,GNAT Debug_Pools g-debpoo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{35b}@anchor{gnat_rm/the_gnat_library id58}@anchor{35c} +@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{35e}@anchor{gnat_rm/the_gnat_library id58}@anchor{35f} @section @code{GNAT.Debug_Utilities} (@code{g-debuti.ads}) @@ -24208,7 +24239,7 @@ to and from string images of address values. Supports both C and Ada formats for hexadecimal literals. @node GNAT Decode_String g-decstr ads,GNAT Decode_UTF8_String g-deutst ads,GNAT Debug_Utilities g-debuti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{35d}@anchor{gnat_rm/the_gnat_library id59}@anchor{35e} +@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{360}@anchor{gnat_rm/the_gnat_library id59}@anchor{361} @section @code{GNAT.Decode_String} (@code{g-decstr.ads}) @@ -24232,7 +24263,7 @@ Useful in conjunction with Unicode character coding. Note there is a preinstantiation for UTF-8. See next entry. @node GNAT Decode_UTF8_String g-deutst ads,GNAT Directory_Operations g-dirope ads,GNAT Decode_String g-decstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{35f}@anchor{gnat_rm/the_gnat_library id60}@anchor{360} +@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{362}@anchor{gnat_rm/the_gnat_library id60}@anchor{363} @section @code{GNAT.Decode_UTF8_String} (@code{g-deutst.ads}) @@ -24253,7 +24284,7 @@ preinstantiation for UTF-8. See next entry. A preinstantiation of GNAT.Decode_Strings for UTF-8 encoding. @node GNAT Directory_Operations g-dirope ads,GNAT Directory_Operations Iteration g-diopit ads,GNAT Decode_UTF8_String g-deutst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{361}@anchor{gnat_rm/the_gnat_library id61}@anchor{362} +@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{364}@anchor{gnat_rm/the_gnat_library id61}@anchor{365} @section @code{GNAT.Directory_Operations} (@code{g-dirope.ads}) @@ -24266,7 +24297,7 @@ the current directory, making new directories, and scanning the files in a directory. @node GNAT Directory_Operations Iteration g-diopit ads,GNAT Dynamic_HTables g-dynhta ads,GNAT Directory_Operations g-dirope ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{363}@anchor{gnat_rm/the_gnat_library id62}@anchor{364} +@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{366}@anchor{gnat_rm/the_gnat_library id62}@anchor{367} @section @code{GNAT.Directory_Operations.Iteration} (@code{g-diopit.ads}) @@ -24278,7 +24309,7 @@ A child unit of GNAT.Directory_Operations providing additional operations for iterating through directories. @node GNAT Dynamic_HTables g-dynhta ads,GNAT Dynamic_Tables g-dyntab ads,GNAT Directory_Operations Iteration g-diopit ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{365}@anchor{gnat_rm/the_gnat_library id63}@anchor{366} +@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{368}@anchor{gnat_rm/the_gnat_library id63}@anchor{369} @section @code{GNAT.Dynamic_HTables} (@code{g-dynhta.ads}) @@ -24296,7 +24327,7 @@ dynamic instances of the hash table, while an instantiation of @code{GNAT.HTable} creates a single instance of the hash table. @node GNAT Dynamic_Tables g-dyntab ads,GNAT Encode_String g-encstr ads,GNAT Dynamic_HTables g-dynhta ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{367}@anchor{gnat_rm/the_gnat_library id64}@anchor{368} +@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{36a}@anchor{gnat_rm/the_gnat_library id64}@anchor{36b} @section @code{GNAT.Dynamic_Tables} (@code{g-dyntab.ads}) @@ -24316,7 +24347,7 @@ dynamic instances of the table, while an instantiation of @code{GNAT.Table} creates a single instance of the table type. @node GNAT Encode_String g-encstr ads,GNAT Encode_UTF8_String g-enutst ads,GNAT Dynamic_Tables g-dyntab ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{369}@anchor{gnat_rm/the_gnat_library id65}@anchor{36a} +@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{36c}@anchor{gnat_rm/the_gnat_library id65}@anchor{36d} @section @code{GNAT.Encode_String} (@code{g-encstr.ads}) @@ -24338,7 +24369,7 @@ encoding method. Useful in conjunction with Unicode character coding. Note there is a preinstantiation for UTF-8. See next entry. @node GNAT Encode_UTF8_String g-enutst ads,GNAT Exception_Actions g-excact ads,GNAT Encode_String g-encstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{36b}@anchor{gnat_rm/the_gnat_library id66}@anchor{36c} +@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{36e}@anchor{gnat_rm/the_gnat_library id66}@anchor{36f} @section @code{GNAT.Encode_UTF8_String} (@code{g-enutst.ads}) @@ -24359,7 +24390,7 @@ Note there is a preinstantiation for UTF-8. See next entry. A preinstantiation of GNAT.Encode_Strings for UTF-8 encoding. @node GNAT Exception_Actions g-excact ads,GNAT Exception_Traces g-exctra ads,GNAT Encode_UTF8_String g-enutst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{36d}@anchor{gnat_rm/the_gnat_library id67}@anchor{36e} +@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{370}@anchor{gnat_rm/the_gnat_library id67}@anchor{371} @section @code{GNAT.Exception_Actions} (@code{g-excact.ads}) @@ -24372,7 +24403,7 @@ for specific exceptions, or when any exception is raised. This can be used for instance to force a core dump to ease debugging. @node GNAT Exception_Traces g-exctra ads,GNAT Exceptions g-except ads,GNAT Exception_Actions g-excact ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{36f}@anchor{gnat_rm/the_gnat_library id68}@anchor{370} +@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{372}@anchor{gnat_rm/the_gnat_library id68}@anchor{373} @section @code{GNAT.Exception_Traces} (@code{g-exctra.ads}) @@ -24386,7 +24417,7 @@ Provides an interface allowing to control automatic output upon exception occurrences. @node GNAT Exceptions g-except ads,GNAT Expect g-expect ads,GNAT Exception_Traces g-exctra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{371}@anchor{gnat_rm/the_gnat_library id69}@anchor{372} +@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{374}@anchor{gnat_rm/the_gnat_library id69}@anchor{375} @section @code{GNAT.Exceptions} (@code{g-except.ads}) @@ -24407,7 +24438,7 @@ predefined exceptions, and for example allows raising @code{Constraint_Error} with a message from a pure subprogram. @node GNAT Expect g-expect ads,GNAT Expect TTY g-exptty ads,GNAT Exceptions g-except ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{373}@anchor{gnat_rm/the_gnat_library id70}@anchor{374} +@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{376}@anchor{gnat_rm/the_gnat_library id70}@anchor{377} @section @code{GNAT.Expect} (@code{g-expect.ads}) @@ -24423,7 +24454,7 @@ It is not implemented for cross ports, and in particular is not implemented for VxWorks or LynxOS. @node GNAT Expect TTY g-exptty ads,GNAT Float_Control g-flocon ads,GNAT Expect g-expect ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{375}@anchor{gnat_rm/the_gnat_library id71}@anchor{376} +@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{378}@anchor{gnat_rm/the_gnat_library id71}@anchor{379} @section @code{GNAT.Expect.TTY} (@code{g-exptty.ads}) @@ -24435,7 +24466,7 @@ ports. It is not implemented for cross ports, and in particular is not implemented for VxWorks or LynxOS. @node GNAT Float_Control g-flocon ads,GNAT Formatted_String g-forstr ads,GNAT Expect TTY g-exptty ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{377}@anchor{gnat_rm/the_gnat_library id72}@anchor{378} +@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{37a}@anchor{gnat_rm/the_gnat_library id72}@anchor{37b} @section @code{GNAT.Float_Control} (@code{g-flocon.ads}) @@ -24449,7 +24480,7 @@ library calls may cause this mode to be modified, and the Reset procedure in this package can be used to reestablish the required mode. @node GNAT Formatted_String g-forstr ads,GNAT Generic_Fast_Math_Functions g-gfmafu ads,GNAT Float_Control g-flocon ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{379}@anchor{gnat_rm/the_gnat_library id73}@anchor{37a} +@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{37c}@anchor{gnat_rm/the_gnat_library id73}@anchor{37d} @section @code{GNAT.Formatted_String} (@code{g-forstr.ads}) @@ -24464,7 +24495,7 @@ derived from Integer, Float or enumerations as values for the formatted string. @node GNAT Generic_Fast_Math_Functions g-gfmafu ads,GNAT Heap_Sort g-heasor ads,GNAT Formatted_String g-forstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-generic-fast-math-functions-g-gfmafu-ads}@anchor{37b}@anchor{gnat_rm/the_gnat_library id74}@anchor{37c} +@anchor{gnat_rm/the_gnat_library gnat-generic-fast-math-functions-g-gfmafu-ads}@anchor{37e}@anchor{gnat_rm/the_gnat_library id74}@anchor{37f} @section @code{GNAT.Generic_Fast_Math_Functions} (@code{g-gfmafu.ads}) @@ -24482,7 +24513,7 @@ have a vector implementation that can be automatically used by the compiler when auto-vectorization is enabled. @node GNAT Heap_Sort g-heasor ads,GNAT Heap_Sort_A g-hesora ads,GNAT Generic_Fast_Math_Functions g-gfmafu ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{37d}@anchor{gnat_rm/the_gnat_library id75}@anchor{37e} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{380}@anchor{gnat_rm/the_gnat_library id75}@anchor{381} @section @code{GNAT.Heap_Sort} (@code{g-heasor.ads}) @@ -24496,7 +24527,7 @@ access-to-procedure values. The algorithm used is a modified heap sort that performs approximately N*log(N) comparisons in the worst case. @node GNAT Heap_Sort_A g-hesora ads,GNAT Heap_Sort_G g-hesorg ads,GNAT Heap_Sort g-heasor ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{37f}@anchor{gnat_rm/the_gnat_library id76}@anchor{380} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{382}@anchor{gnat_rm/the_gnat_library id76}@anchor{383} @section @code{GNAT.Heap_Sort_A} (@code{g-hesora.ads}) @@ -24512,7 +24543,7 @@ This differs from @code{GNAT.Heap_Sort} in having a less convenient interface, but may be slightly more efficient. @node GNAT Heap_Sort_G g-hesorg ads,GNAT HTable g-htable ads,GNAT Heap_Sort_A g-hesora ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{381}@anchor{gnat_rm/the_gnat_library id77}@anchor{382} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{384}@anchor{gnat_rm/the_gnat_library id77}@anchor{385} @section @code{GNAT.Heap_Sort_G} (@code{g-hesorg.ads}) @@ -24526,7 +24557,7 @@ if the procedures can be inlined, at the expense of duplicating code for multiple instantiations. @node GNAT HTable g-htable ads,GNAT IO g-io ads,GNAT Heap_Sort_G g-hesorg ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{383}@anchor{gnat_rm/the_gnat_library id78}@anchor{384} +@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{386}@anchor{gnat_rm/the_gnat_library id78}@anchor{387} @section @code{GNAT.HTable} (@code{g-htable.ads}) @@ -24539,7 +24570,7 @@ data. Provides two approaches, one a simple static approach, and the other allowing arbitrary dynamic hash tables. @node GNAT IO g-io ads,GNAT IO_Aux g-io_aux ads,GNAT HTable g-htable ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{385}@anchor{gnat_rm/the_gnat_library id79}@anchor{386} +@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{388}@anchor{gnat_rm/the_gnat_library id79}@anchor{389} @section @code{GNAT.IO} (@code{g-io.ads}) @@ -24555,7 +24586,7 @@ Standard_Input, and writing characters, strings and integers to either Standard_Output or Standard_Error. @node GNAT IO_Aux g-io_aux ads,GNAT Lock_Files g-locfil ads,GNAT IO g-io ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{387}@anchor{gnat_rm/the_gnat_library id80}@anchor{388} +@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{38a}@anchor{gnat_rm/the_gnat_library id80}@anchor{38b} @section @code{GNAT.IO_Aux} (@code{g-io_aux.ads}) @@ -24569,7 +24600,7 @@ Provides some auxiliary functions for use with Text_IO, including a test for whether a file exists, and functions for reading a line of text. @node GNAT Lock_Files g-locfil ads,GNAT MBBS_Discrete_Random g-mbdira ads,GNAT IO_Aux g-io_aux ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{389}@anchor{gnat_rm/the_gnat_library id81}@anchor{38a} +@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{38c}@anchor{gnat_rm/the_gnat_library id81}@anchor{38d} @section @code{GNAT.Lock_Files} (@code{g-locfil.ads}) @@ -24583,7 +24614,7 @@ Provides a general interface for using files as locks. Can be used for providing program level synchronization. @node GNAT MBBS_Discrete_Random g-mbdira ads,GNAT MBBS_Float_Random g-mbflra ads,GNAT Lock_Files g-locfil ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{38b}@anchor{gnat_rm/the_gnat_library id82}@anchor{38c} +@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{38e}@anchor{gnat_rm/the_gnat_library id82}@anchor{38f} @section @code{GNAT.MBBS_Discrete_Random} (@code{g-mbdira.ads}) @@ -24595,7 +24626,7 @@ The original implementation of @code{Ada.Numerics.Discrete_Random}. Uses a modified version of the Blum-Blum-Shub generator. @node GNAT MBBS_Float_Random g-mbflra ads,GNAT MD5 g-md5 ads,GNAT MBBS_Discrete_Random g-mbdira ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{38d}@anchor{gnat_rm/the_gnat_library id83}@anchor{38e} +@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{390}@anchor{gnat_rm/the_gnat_library id83}@anchor{391} @section @code{GNAT.MBBS_Float_Random} (@code{g-mbflra.ads}) @@ -24607,7 +24638,7 @@ The original implementation of @code{Ada.Numerics.Float_Random}. Uses a modified version of the Blum-Blum-Shub generator. @node GNAT MD5 g-md5 ads,GNAT Memory_Dump g-memdum ads,GNAT MBBS_Float_Random g-mbflra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{38f}@anchor{gnat_rm/the_gnat_library id84}@anchor{390} +@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{392}@anchor{gnat_rm/the_gnat_library id84}@anchor{393} @section @code{GNAT.MD5} (@code{g-md5.ads}) @@ -24620,7 +24651,7 @@ the HMAC-MD5 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT Memory_Dump g-memdum ads,GNAT Most_Recent_Exception g-moreex ads,GNAT MD5 g-md5 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{391}@anchor{gnat_rm/the_gnat_library id85}@anchor{392} +@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{394}@anchor{gnat_rm/the_gnat_library id85}@anchor{395} @section @code{GNAT.Memory_Dump} (@code{g-memdum.ads}) @@ -24633,7 +24664,7 @@ standard output or standard error files. Uses GNAT.IO for actual output. @node GNAT Most_Recent_Exception g-moreex ads,GNAT OS_Lib g-os_lib ads,GNAT Memory_Dump g-memdum ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{393}@anchor{gnat_rm/the_gnat_library id86}@anchor{394} +@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{396}@anchor{gnat_rm/the_gnat_library id86}@anchor{397} @section @code{GNAT.Most_Recent_Exception} (@code{g-moreex.ads}) @@ -24647,7 +24678,7 @@ various logging purposes, including duplicating functionality of some Ada 83 implementation dependent extensions. @node GNAT OS_Lib g-os_lib ads,GNAT Perfect_Hash_Generators g-pehage ads,GNAT Most_Recent_Exception g-moreex ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{395}@anchor{gnat_rm/the_gnat_library id87}@anchor{396} +@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{398}@anchor{gnat_rm/the_gnat_library id87}@anchor{399} @section @code{GNAT.OS_Lib} (@code{g-os_lib.ads}) @@ -24663,7 +24694,7 @@ including a portable spawn procedure, and access to environment variables and error return codes. @node GNAT Perfect_Hash_Generators g-pehage ads,GNAT Random_Numbers g-rannum ads,GNAT OS_Lib g-os_lib ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{397}@anchor{gnat_rm/the_gnat_library id88}@anchor{398} +@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{39a}@anchor{gnat_rm/the_gnat_library id88}@anchor{39b} @section @code{GNAT.Perfect_Hash_Generators} (@code{g-pehage.ads}) @@ -24681,7 +24712,7 @@ hashcode are in the same order. These hashing functions are very convenient for use with realtime applications. @node GNAT Random_Numbers g-rannum ads,GNAT Regexp g-regexp ads,GNAT Perfect_Hash_Generators g-pehage ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{399}@anchor{gnat_rm/the_gnat_library id89}@anchor{39a} +@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{39c}@anchor{gnat_rm/the_gnat_library id89}@anchor{39d} @section @code{GNAT.Random_Numbers} (@code{g-rannum.ads}) @@ -24695,7 +24726,7 @@ however NOT suitable for situations requiring cryptographically secure randomness. @node GNAT Regexp g-regexp ads,GNAT Registry g-regist ads,GNAT Random_Numbers g-rannum ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{270}@anchor{gnat_rm/the_gnat_library id90}@anchor{39b} +@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{273}@anchor{gnat_rm/the_gnat_library id90}@anchor{39e} @section @code{GNAT.Regexp} (@code{g-regexp.ads}) @@ -24711,7 +24742,7 @@ simplest of the three pattern matching packages provided, and is particularly suitable for ‘file globbing’ applications. @node GNAT Registry g-regist ads,GNAT Regpat g-regpat ads,GNAT Regexp g-regexp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{39c}@anchor{gnat_rm/the_gnat_library id91}@anchor{39d} +@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{39f}@anchor{gnat_rm/the_gnat_library id91}@anchor{3a0} @section @code{GNAT.Registry} (@code{g-regist.ads}) @@ -24725,7 +24756,7 @@ registry API, but at a lower level of abstraction, refer to the Win32.Winreg package provided with the Win32Ada binding @node GNAT Regpat g-regpat ads,GNAT Rewrite_Data g-rewdat ads,GNAT Registry g-regist ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{39e}@anchor{gnat_rm/the_gnat_library id92}@anchor{39f} +@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{3a1}@anchor{gnat_rm/the_gnat_library id92}@anchor{3a2} @section @code{GNAT.Regpat} (@code{g-regpat.ads}) @@ -24740,7 +24771,7 @@ from the original V7 style regular expression library written in C by Henry Spencer (and binary compatible with this C library). @node GNAT Rewrite_Data g-rewdat ads,GNAT Secondary_Stack_Info g-sestin ads,GNAT Regpat g-regpat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{3a0}@anchor{gnat_rm/the_gnat_library id93}@anchor{3a1} +@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{3a3}@anchor{gnat_rm/the_gnat_library id93}@anchor{3a4} @section @code{GNAT.Rewrite_Data} (@code{g-rewdat.ads}) @@ -24754,7 +24785,7 @@ full content to be processed is not loaded into memory all at once. This makes this interface usable for large files or socket streams. @node GNAT Secondary_Stack_Info g-sestin ads,GNAT Semaphores g-semaph ads,GNAT Rewrite_Data g-rewdat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{3a2}@anchor{gnat_rm/the_gnat_library id94}@anchor{3a3} +@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{3a5}@anchor{gnat_rm/the_gnat_library id94}@anchor{3a6} @section @code{GNAT.Secondary_Stack_Info} (@code{g-sestin.ads}) @@ -24766,7 +24797,7 @@ Provides the capability to query the high water mark of the current task’s secondary stack. @node GNAT Semaphores g-semaph ads,GNAT Serial_Communications g-sercom ads,GNAT Secondary_Stack_Info g-sestin ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{3a4}@anchor{gnat_rm/the_gnat_library id95}@anchor{3a5} +@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{3a7}@anchor{gnat_rm/the_gnat_library id95}@anchor{3a8} @section @code{GNAT.Semaphores} (@code{g-semaph.ads}) @@ -24777,7 +24808,7 @@ secondary stack. Provides classic counting and binary semaphores using protected types. @node GNAT Serial_Communications g-sercom ads,GNAT SHA1 g-sha1 ads,GNAT Semaphores g-semaph ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{3a6}@anchor{gnat_rm/the_gnat_library id96}@anchor{3a7} +@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{3a9}@anchor{gnat_rm/the_gnat_library id96}@anchor{3aa} @section @code{GNAT.Serial_Communications} (@code{g-sercom.ads}) @@ -24789,7 +24820,7 @@ Provides a simple interface to send and receive data over a serial port. This is only supported on GNU/Linux and Windows. @node GNAT SHA1 g-sha1 ads,GNAT SHA224 g-sha224 ads,GNAT Serial_Communications g-sercom ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{3a8}@anchor{gnat_rm/the_gnat_library id97}@anchor{3a9} +@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{3ab}@anchor{gnat_rm/the_gnat_library id97}@anchor{3ac} @section @code{GNAT.SHA1} (@code{g-sha1.ads}) @@ -24802,7 +24833,7 @@ and RFC 3174, and the HMAC-SHA1 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA224 g-sha224 ads,GNAT SHA256 g-sha256 ads,GNAT SHA1 g-sha1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{3aa}@anchor{gnat_rm/the_gnat_library id98}@anchor{3ab} +@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{3ad}@anchor{gnat_rm/the_gnat_library id98}@anchor{3ae} @section @code{GNAT.SHA224} (@code{g-sha224.ads}) @@ -24815,7 +24846,7 @@ and the HMAC-SHA224 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA256 g-sha256 ads,GNAT SHA384 g-sha384 ads,GNAT SHA224 g-sha224 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{3ac}@anchor{gnat_rm/the_gnat_library id99}@anchor{3ad} +@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{3af}@anchor{gnat_rm/the_gnat_library id99}@anchor{3b0} @section @code{GNAT.SHA256} (@code{g-sha256.ads}) @@ -24828,7 +24859,7 @@ and the HMAC-SHA256 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA384 g-sha384 ads,GNAT SHA512 g-sha512 ads,GNAT SHA256 g-sha256 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{3ae}@anchor{gnat_rm/the_gnat_library id100}@anchor{3af} +@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{3b1}@anchor{gnat_rm/the_gnat_library id100}@anchor{3b2} @section @code{GNAT.SHA384} (@code{g-sha384.ads}) @@ -24841,7 +24872,7 @@ and the HMAC-SHA384 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA512 g-sha512 ads,GNAT Signals g-signal ads,GNAT SHA384 g-sha384 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3b0}@anchor{gnat_rm/the_gnat_library id101}@anchor{3b1} +@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3b3}@anchor{gnat_rm/the_gnat_library id101}@anchor{3b4} @section @code{GNAT.SHA512} (@code{g-sha512.ads}) @@ -24854,7 +24885,7 @@ and the HMAC-SHA512 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT Signals g-signal ads,GNAT Sockets g-socket ads,GNAT SHA512 g-sha512 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{3b2}@anchor{gnat_rm/the_gnat_library id102}@anchor{3b3} +@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{3b5}@anchor{gnat_rm/the_gnat_library id102}@anchor{3b6} @section @code{GNAT.Signals} (@code{g-signal.ads}) @@ -24866,7 +24897,7 @@ Provides the ability to manipulate the blocked status of signals on supported targets. @node GNAT Sockets g-socket ads,GNAT Source_Info g-souinf ads,GNAT Signals g-signal ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3b4}@anchor{gnat_rm/the_gnat_library id103}@anchor{3b5} +@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3b7}@anchor{gnat_rm/the_gnat_library id103}@anchor{3b8} @section @code{GNAT.Sockets} (@code{g-socket.ads}) @@ -24881,7 +24912,7 @@ on all native GNAT ports and on VxWorks cross ports. It is not implemented for the LynxOS cross port. @node GNAT Source_Info g-souinf ads,GNAT Spelling_Checker g-speche ads,GNAT Sockets g-socket ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3b6}@anchor{gnat_rm/the_gnat_library id104}@anchor{3b7} +@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3b9}@anchor{gnat_rm/the_gnat_library id104}@anchor{3ba} @section @code{GNAT.Source_Info} (@code{g-souinf.ads}) @@ -24895,7 +24926,7 @@ subprograms yielding the date and time of the current compilation (like the C macros @code{__DATE__} and @code{__TIME__}) @node GNAT Spelling_Checker g-speche ads,GNAT Spelling_Checker_Generic g-spchge ads,GNAT Source_Info g-souinf ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3b8}@anchor{gnat_rm/the_gnat_library id105}@anchor{3b9} +@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3bb}@anchor{gnat_rm/the_gnat_library id105}@anchor{3bc} @section @code{GNAT.Spelling_Checker} (@code{g-speche.ads}) @@ -24907,7 +24938,7 @@ Provides a function for determining whether one string is a plausible near misspelling of another string. @node GNAT Spelling_Checker_Generic g-spchge ads,GNAT Spitbol Patterns g-spipat ads,GNAT Spelling_Checker g-speche ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3ba}@anchor{gnat_rm/the_gnat_library id106}@anchor{3bb} +@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3bd}@anchor{gnat_rm/the_gnat_library id106}@anchor{3be} @section @code{GNAT.Spelling_Checker_Generic} (@code{g-spchge.ads}) @@ -24920,7 +24951,7 @@ determining whether one string is a plausible near misspelling of another string. @node GNAT Spitbol Patterns g-spipat ads,GNAT Spitbol g-spitbo ads,GNAT Spelling_Checker_Generic g-spchge ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3bc}@anchor{gnat_rm/the_gnat_library id107}@anchor{3bd} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3bf}@anchor{gnat_rm/the_gnat_library id107}@anchor{3c0} @section @code{GNAT.Spitbol.Patterns} (@code{g-spipat.ads}) @@ -24936,7 +24967,7 @@ the SNOBOL4 dynamic pattern construction and matching capabilities, using the efficient algorithm developed by Robert Dewar for the SPITBOL system. @node GNAT Spitbol g-spitbo ads,GNAT Spitbol Table_Boolean g-sptabo ads,GNAT Spitbol Patterns g-spipat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3be}@anchor{gnat_rm/the_gnat_library id108}@anchor{3bf} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3c1}@anchor{gnat_rm/the_gnat_library id108}@anchor{3c2} @section @code{GNAT.Spitbol} (@code{g-spitbo.ads}) @@ -24951,7 +24982,7 @@ useful for constructing arbitrary mappings from strings in the style of the SNOBOL4 TABLE function. @node GNAT Spitbol Table_Boolean g-sptabo ads,GNAT Spitbol Table_Integer g-sptain ads,GNAT Spitbol g-spitbo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3c0}@anchor{gnat_rm/the_gnat_library id109}@anchor{3c1} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3c3}@anchor{gnat_rm/the_gnat_library id109}@anchor{3c4} @section @code{GNAT.Spitbol.Table_Boolean} (@code{g-sptabo.ads}) @@ -24966,7 +24997,7 @@ for type @code{Standard.Boolean}, giving an implementation of sets of string values. @node GNAT Spitbol Table_Integer g-sptain ads,GNAT Spitbol Table_VString g-sptavs ads,GNAT Spitbol Table_Boolean g-sptabo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3c2}@anchor{gnat_rm/the_gnat_library id110}@anchor{3c3} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3c5}@anchor{gnat_rm/the_gnat_library id110}@anchor{3c6} @section @code{GNAT.Spitbol.Table_Integer} (@code{g-sptain.ads}) @@ -24983,7 +25014,7 @@ for type @code{Standard.Integer}, giving an implementation of maps from string to integer values. @node GNAT Spitbol Table_VString g-sptavs ads,GNAT SSE g-sse ads,GNAT Spitbol Table_Integer g-sptain ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3c4}@anchor{gnat_rm/the_gnat_library id111}@anchor{3c5} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3c7}@anchor{gnat_rm/the_gnat_library id111}@anchor{3c8} @section @code{GNAT.Spitbol.Table_VString} (@code{g-sptavs.ads}) @@ -25000,7 +25031,7 @@ a variable length string type, giving an implementation of general maps from strings to strings. @node GNAT SSE g-sse ads,GNAT SSE Vector_Types g-ssvety ads,GNAT Spitbol Table_VString g-sptavs ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3c6}@anchor{gnat_rm/the_gnat_library id112}@anchor{3c7} +@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3c9}@anchor{gnat_rm/the_gnat_library id112}@anchor{3ca} @section @code{GNAT.SSE} (@code{g-sse.ads}) @@ -25012,7 +25043,7 @@ targets. It exposes vector component types together with a general introduction to the binding contents and use. @node GNAT SSE Vector_Types g-ssvety ads,GNAT String_Hash g-strhas ads,GNAT SSE g-sse ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3c8}@anchor{gnat_rm/the_gnat_library id113}@anchor{3c9} +@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3cb}@anchor{gnat_rm/the_gnat_library id113}@anchor{3cc} @section @code{GNAT.SSE.Vector_Types} (@code{g-ssvety.ads}) @@ -25021,7 +25052,7 @@ introduction to the binding contents and use. SSE vector types for use with SSE related intrinsics. @node GNAT String_Hash g-strhas ads,GNAT Strings g-string ads,GNAT SSE Vector_Types g-ssvety ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3ca}@anchor{gnat_rm/the_gnat_library id114}@anchor{3cb} +@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3cd}@anchor{gnat_rm/the_gnat_library id114}@anchor{3ce} @section @code{GNAT.String_Hash} (@code{g-strhas.ads}) @@ -25033,7 +25064,7 @@ Provides a generic hash function working on arrays of scalars. Both the scalar type and the hash result type are parameters. @node GNAT Strings g-string ads,GNAT String_Split g-strspl ads,GNAT String_Hash g-strhas ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3cc}@anchor{gnat_rm/the_gnat_library id115}@anchor{3cd} +@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3cf}@anchor{gnat_rm/the_gnat_library id115}@anchor{3d0} @section @code{GNAT.Strings} (@code{g-string.ads}) @@ -25043,7 +25074,7 @@ Common String access types and related subprograms. Basically it defines a string access and an array of string access types. @node GNAT String_Split g-strspl ads,GNAT Table g-table ads,GNAT Strings g-string ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3ce}@anchor{gnat_rm/the_gnat_library id116}@anchor{3cf} +@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3d1}@anchor{gnat_rm/the_gnat_library id116}@anchor{3d2} @section @code{GNAT.String_Split} (@code{g-strspl.ads}) @@ -25057,7 +25088,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node GNAT Table g-table ads,GNAT Task_Lock g-tasloc ads,GNAT String_Split g-strspl ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3d0}@anchor{gnat_rm/the_gnat_library id117}@anchor{3d1} +@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3d3}@anchor{gnat_rm/the_gnat_library id117}@anchor{3d4} @section @code{GNAT.Table} (@code{g-table.ads}) @@ -25077,7 +25108,7 @@ while an instantiation of @code{GNAT.Dynamic_Tables} creates a type that can be used to define dynamic instances of the table. @node GNAT Task_Lock g-tasloc ads,GNAT Time_Stamp g-timsta ads,GNAT Table g-table ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3d2}@anchor{gnat_rm/the_gnat_library id118}@anchor{3d3} +@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3d5}@anchor{gnat_rm/the_gnat_library id118}@anchor{3d6} @section @code{GNAT.Task_Lock} (@code{g-tasloc.ads}) @@ -25094,7 +25125,7 @@ single global task lock. Appropriate for use in situations where contention between tasks is very rarely expected. @node GNAT Time_Stamp g-timsta ads,GNAT Threads g-thread ads,GNAT Task_Lock g-tasloc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3d4}@anchor{gnat_rm/the_gnat_library id119}@anchor{3d5} +@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3d7}@anchor{gnat_rm/the_gnat_library id119}@anchor{3d8} @section @code{GNAT.Time_Stamp} (@code{g-timsta.ads}) @@ -25109,7 +25140,7 @@ represents the current date and time in ISO 8601 format. This is a very simple routine with minimal code and there are no dependencies on any other unit. @node GNAT Threads g-thread ads,GNAT Traceback g-traceb ads,GNAT Time_Stamp g-timsta ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3d6}@anchor{gnat_rm/the_gnat_library id120}@anchor{3d7} +@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3d9}@anchor{gnat_rm/the_gnat_library id120}@anchor{3da} @section @code{GNAT.Threads} (@code{g-thread.ads}) @@ -25126,7 +25157,7 @@ further details if your program has threads that are created by a non-Ada environment which then accesses Ada code. @node GNAT Traceback g-traceb ads,GNAT Traceback Symbolic g-trasym ads,GNAT Threads g-thread ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3d8}@anchor{gnat_rm/the_gnat_library id121}@anchor{3d9} +@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3db}@anchor{gnat_rm/the_gnat_library id121}@anchor{3dc} @section @code{GNAT.Traceback} (@code{g-traceb.ads}) @@ -25138,7 +25169,7 @@ Provides a facility for obtaining non-symbolic traceback information, useful in various debugging situations. @node GNAT Traceback Symbolic g-trasym ads,GNAT UTF_32 g-utf_32 ads,GNAT Traceback g-traceb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3da}@anchor{gnat_rm/the_gnat_library id122}@anchor{3db} +@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3dd}@anchor{gnat_rm/the_gnat_library id122}@anchor{3de} @section @code{GNAT.Traceback.Symbolic} (@code{g-trasym.ads}) @@ -25147,7 +25178,7 @@ in various debugging situations. @geindex Trace back facilities @node GNAT UTF_32 g-utf_32 ads,GNAT UTF_32_Spelling_Checker g-u3spch ads,GNAT Traceback Symbolic g-trasym ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-utf-32-ads}@anchor{3dc}@anchor{gnat_rm/the_gnat_library id123}@anchor{3dd} +@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-utf-32-ads}@anchor{3df}@anchor{gnat_rm/the_gnat_library id123}@anchor{3e0} @section @code{GNAT.UTF_32} (@code{g-utf_32.ads}) @@ -25166,7 +25197,7 @@ lower case to upper case fold routine corresponding to the Ada 2005 rules for identifier equivalence. @node GNAT UTF_32_Spelling_Checker g-u3spch ads,GNAT Wide_Spelling_Checker g-wispch ads,GNAT UTF_32 g-utf_32 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-utf-32-spelling-checker-g-u3spch-ads}@anchor{3de}@anchor{gnat_rm/the_gnat_library id124}@anchor{3df} +@anchor{gnat_rm/the_gnat_library gnat-utf-32-spelling-checker-g-u3spch-ads}@anchor{3e1}@anchor{gnat_rm/the_gnat_library id124}@anchor{3e2} @section @code{GNAT.UTF_32_Spelling_Checker} (@code{g-u3spch.ads}) @@ -25179,7 +25210,7 @@ near misspelling of another wide wide string, where the strings are represented using the UTF_32_String type defined in System.Wch_Cnv. @node GNAT Wide_Spelling_Checker g-wispch ads,GNAT Wide_String_Split g-wistsp ads,GNAT UTF_32_Spelling_Checker g-u3spch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3e0}@anchor{gnat_rm/the_gnat_library id125}@anchor{3e1} +@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3e3}@anchor{gnat_rm/the_gnat_library id125}@anchor{3e4} @section @code{GNAT.Wide_Spelling_Checker} (@code{g-wispch.ads}) @@ -25191,7 +25222,7 @@ Provides a function for determining whether one wide string is a plausible near misspelling of another wide string. @node GNAT Wide_String_Split g-wistsp ads,GNAT Wide_Wide_Spelling_Checker g-zspche ads,GNAT Wide_Spelling_Checker g-wispch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3e2}@anchor{gnat_rm/the_gnat_library id126}@anchor{3e3} +@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3e5}@anchor{gnat_rm/the_gnat_library id126}@anchor{3e6} @section @code{GNAT.Wide_String_Split} (@code{g-wistsp.ads}) @@ -25205,7 +25236,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node GNAT Wide_Wide_Spelling_Checker g-zspche ads,GNAT Wide_Wide_String_Split g-zistsp ads,GNAT Wide_String_Split g-wistsp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3e4}@anchor{gnat_rm/the_gnat_library id127}@anchor{3e5} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3e7}@anchor{gnat_rm/the_gnat_library id127}@anchor{3e8} @section @code{GNAT.Wide_Wide_Spelling_Checker} (@code{g-zspche.ads}) @@ -25217,7 +25248,7 @@ Provides a function for determining whether one wide wide string is a plausible near misspelling of another wide wide string. @node GNAT Wide_Wide_String_Split g-zistsp ads,Interfaces C Extensions i-cexten ads,GNAT Wide_Wide_Spelling_Checker g-zspche ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{3e6}@anchor{gnat_rm/the_gnat_library id128}@anchor{3e7} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{3e9}@anchor{gnat_rm/the_gnat_library id128}@anchor{3ea} @section @code{GNAT.Wide_Wide_String_Split} (@code{g-zistsp.ads}) @@ -25231,7 +25262,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node Interfaces C Extensions i-cexten ads,Interfaces C Streams i-cstrea ads,GNAT Wide_Wide_String_Split g-zistsp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id129}@anchor{3e8}@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{3e9} +@anchor{gnat_rm/the_gnat_library id129}@anchor{3eb}@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{3ec} @section @code{Interfaces.C.Extensions} (@code{i-cexten.ads}) @@ -25242,7 +25273,7 @@ for use with either manually or automatically generated bindings to C libraries. @node Interfaces C Streams i-cstrea ads,Interfaces Packed_Decimal i-pacdec ads,Interfaces C Extensions i-cexten ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id130}@anchor{3ea}@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{3eb} +@anchor{gnat_rm/the_gnat_library id130}@anchor{3ed}@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{3ee} @section @code{Interfaces.C.Streams} (@code{i-cstrea.ads}) @@ -25255,7 +25286,7 @@ This package is a binding for the most commonly used operations on C streams. @node Interfaces Packed_Decimal i-pacdec ads,Interfaces VxWorks i-vxwork ads,Interfaces C Streams i-cstrea ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id131}@anchor{3ec}@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{3ed} +@anchor{gnat_rm/the_gnat_library id131}@anchor{3ef}@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{3f0} @section @code{Interfaces.Packed_Decimal} (@code{i-pacdec.ads}) @@ -25270,7 +25301,7 @@ from a packed decimal format compatible with that used on IBM mainframes. @node Interfaces VxWorks i-vxwork ads,Interfaces VxWorks IO i-vxwoio ads,Interfaces Packed_Decimal i-pacdec ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id132}@anchor{3ee}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{3ef} +@anchor{gnat_rm/the_gnat_library id132}@anchor{3f1}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{3f2} @section @code{Interfaces.VxWorks} (@code{i-vxwork.ads}) @@ -25284,7 +25315,7 @@ mainframes. This package provides a limited binding to the VxWorks API. @node Interfaces VxWorks IO i-vxwoio ads,System Address_Image s-addima ads,Interfaces VxWorks i-vxwork ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id133}@anchor{3f0}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{3f1} +@anchor{gnat_rm/the_gnat_library id133}@anchor{3f3}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{3f4} @section @code{Interfaces.VxWorks.IO} (@code{i-vxwoio.ads}) @@ -25307,7 +25338,7 @@ function codes. A particular use of this package is to enable the use of Get_Immediate under VxWorks. @node System Address_Image s-addima ads,System Assertions s-assert ads,Interfaces VxWorks IO i-vxwoio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id134}@anchor{3f2}@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{3f3} +@anchor{gnat_rm/the_gnat_library id134}@anchor{3f5}@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{3f6} @section @code{System.Address_Image} (@code{s-addima.ads}) @@ -25323,7 +25354,7 @@ function that gives an (implementation dependent) string which identifies an address. @node System Assertions s-assert ads,System Atomic_Counters s-atocou ads,System Address_Image s-addima ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id135}@anchor{3f4}@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{3f5} +@anchor{gnat_rm/the_gnat_library id135}@anchor{3f7}@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{3f8} @section @code{System.Assertions} (@code{s-assert.ads}) @@ -25339,7 +25370,7 @@ by an run-time assertion failure, as well as the routine that is used internally to raise this assertion. @node System Atomic_Counters s-atocou ads,System Memory s-memory ads,System Assertions s-assert ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id136}@anchor{3f6}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{3f7} +@anchor{gnat_rm/the_gnat_library id136}@anchor{3f9}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{3fa} @section @code{System.Atomic_Counters} (@code{s-atocou.ads}) @@ -25353,7 +25384,7 @@ on most targets, including all Alpha, AARCH64, ARM, ia64, PowerPC, SPARC V9, x86, and x86_64 platforms. @node System Memory s-memory ads,System Multiprocessors s-multip ads,System Atomic_Counters s-atocou ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id137}@anchor{3f8}@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{3f9} +@anchor{gnat_rm/the_gnat_library id137}@anchor{3fb}@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{3fc} @section @code{System.Memory} (@code{s-memory.ads}) @@ -25371,7 +25402,7 @@ calls to this unit may be made for low level allocation uses (for example see the body of @code{GNAT.Tables}). @node System Multiprocessors s-multip ads,System Multiprocessors Dispatching_Domains s-mudido ads,System Memory s-memory ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id138}@anchor{3fa}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{3fb} +@anchor{gnat_rm/the_gnat_library id138}@anchor{3fd}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{3fe} @section @code{System.Multiprocessors} (@code{s-multip.ads}) @@ -25384,7 +25415,7 @@ in GNAT we also make it available in Ada 95 and Ada 2005 (where it is technically an implementation-defined addition). @node System Multiprocessors Dispatching_Domains s-mudido ads,System Partition_Interface s-parint ads,System Multiprocessors s-multip ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id139}@anchor{3fc}@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{3fd} +@anchor{gnat_rm/the_gnat_library id139}@anchor{3ff}@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{400} @section @code{System.Multiprocessors.Dispatching_Domains} (@code{s-mudido.ads}) @@ -25397,7 +25428,7 @@ in GNAT we also make it available in Ada 95 and Ada 2005 (where it is technically an implementation-defined addition). @node System Partition_Interface s-parint ads,System Pool_Global s-pooglo ads,System Multiprocessors Dispatching_Domains s-mudido ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id140}@anchor{3fe}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{3ff} +@anchor{gnat_rm/the_gnat_library id140}@anchor{401}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{402} @section @code{System.Partition_Interface} (@code{s-parint.ads}) @@ -25410,7 +25441,7 @@ is used primarily in a distribution context when using Annex E with @code{GLADE}. @node System Pool_Global s-pooglo ads,System Pool_Local s-pooloc ads,System Partition_Interface s-parint ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id141}@anchor{400}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{401} +@anchor{gnat_rm/the_gnat_library id141}@anchor{403}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{404} @section @code{System.Pool_Global} (@code{s-pooglo.ads}) @@ -25427,7 +25458,7 @@ declared. It uses malloc/free to allocate/free and does not attempt to do any automatic reclamation. @node System Pool_Local s-pooloc ads,System Restrictions s-restri ads,System Pool_Global s-pooglo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id142}@anchor{402}@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{403} +@anchor{gnat_rm/the_gnat_library id142}@anchor{405}@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{406} @section @code{System.Pool_Local} (@code{s-pooloc.ads}) @@ -25444,7 +25475,7 @@ a list of allocated blocks, so that all storage allocated for the pool can be freed automatically when the pool is finalized. @node System Restrictions s-restri ads,System Rident s-rident ads,System Pool_Local s-pooloc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id143}@anchor{404}@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{405} +@anchor{gnat_rm/the_gnat_library id143}@anchor{407}@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{408} @section @code{System.Restrictions} (@code{s-restri.ads}) @@ -25460,7 +25491,7 @@ compiler determined information on which restrictions are violated by one or more packages in the partition. @node System Rident s-rident ads,System Strings Stream_Ops s-ststop ads,System Restrictions s-restri ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id144}@anchor{406}@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{407} +@anchor{gnat_rm/the_gnat_library id144}@anchor{409}@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{40a} @section @code{System.Rident} (@code{s-rident.ads}) @@ -25476,7 +25507,7 @@ since the necessary instantiation is included in package System.Restrictions. @node System Strings Stream_Ops s-ststop ads,System Unsigned_Types s-unstyp ads,System Rident s-rident ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id145}@anchor{408}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{409} +@anchor{gnat_rm/the_gnat_library id145}@anchor{40b}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{40c} @section @code{System.Strings.Stream_Ops} (@code{s-ststop.ads}) @@ -25492,7 +25523,7 @@ stream attributes are applied to string types, but the subprograms in this package can be used directly by application programs. @node System Unsigned_Types s-unstyp ads,System Wch_Cnv s-wchcnv ads,System Strings Stream_Ops s-ststop ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id146}@anchor{40a}@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{40b} +@anchor{gnat_rm/the_gnat_library id146}@anchor{40d}@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{40e} @section @code{System.Unsigned_Types} (@code{s-unstyp.ads}) @@ -25505,7 +25536,7 @@ also contains some related definitions for other specialized types used by the compiler in connection with packed array types. @node System Wch_Cnv s-wchcnv ads,System Wch_Con s-wchcon ads,System Unsigned_Types s-unstyp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id147}@anchor{40c}@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{40d} +@anchor{gnat_rm/the_gnat_library id147}@anchor{40f}@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{410} @section @code{System.Wch_Cnv} (@code{s-wchcnv.ads}) @@ -25526,7 +25557,7 @@ encoding method. It uses definitions in package @code{System.Wch_Con}. @node System Wch_Con s-wchcon ads,,System Wch_Cnv s-wchcnv ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id148}@anchor{40e}@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{40f} +@anchor{gnat_rm/the_gnat_library id148}@anchor{411}@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{412} @section @code{System.Wch_Con} (@code{s-wchcon.ads}) @@ -25538,7 +25569,7 @@ in ordinary strings. These definitions are used by the package @code{System.Wch_Cnv}. @node Interfacing to Other Languages,Specialized Needs Annexes,The GNAT Library,Top -@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{410}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{411}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{11} +@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{413}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{414}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{11} @chapter Interfacing to Other Languages @@ -25556,7 +25587,7 @@ provided. @end menu @node Interfacing to C,Interfacing to C++,,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{412}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{413} +@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{415}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{416} @section Interfacing to C @@ -25696,7 +25727,7 @@ of the length corresponding to the @code{type'Size} value in Ada. @end itemize @node Interfacing to C++,Interfacing to COBOL,Interfacing to C,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{49}@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{414} +@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{49}@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{417} @section Interfacing to C++ @@ -25753,7 +25784,7 @@ The @code{External_Name} is the name of the C++ RTTI symbol. You can then cover a specific C++ exception in an exception handler. @node Interfacing to COBOL,Interfacing to Fortran,Interfacing to C++,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{415}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{416} +@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{418}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{419} @section Interfacing to COBOL @@ -25761,7 +25792,7 @@ Interfacing to COBOL is achieved as described in section B.4 of the Ada Reference Manual. @node Interfacing to Fortran,Interfacing to non-GNAT Ada code,Interfacing to COBOL,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{417}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{418} +@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{41a}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{41b} @section Interfacing to Fortran @@ -25771,7 +25802,7 @@ multi-dimensional array causes the array to be stored in column-major order as required for convenient interface to Fortran. @node Interfacing to non-GNAT Ada code,,Interfacing to Fortran,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{419}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{41a} +@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{41c}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{41d} @section Interfacing to non-GNAT Ada code @@ -25795,7 +25826,7 @@ values or simple record types without variants, or simple array types with fixed bounds. @node Specialized Needs Annexes,Implementation of Specific Ada Features,Interfacing to Other Languages,Top -@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{41b}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{41c}@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{12} +@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{41e}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{41f}@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{12} @chapter Specialized Needs Annexes @@ -25836,7 +25867,7 @@ in Ada 2005) is fully implemented. @end table @node Implementation of Specific Ada Features,Implementation of Ada 2012 Features,Specialized Needs Annexes,Top -@anchor{gnat_rm/implementation_of_specific_ada_features doc}@anchor{41d}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{41e}@anchor{gnat_rm/implementation_of_specific_ada_features implementation-of-specific-ada-features}@anchor{13} +@anchor{gnat_rm/implementation_of_specific_ada_features doc}@anchor{420}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{421}@anchor{gnat_rm/implementation_of_specific_ada_features implementation-of-specific-ada-features}@anchor{13} @chapter Implementation of Specific Ada Features @@ -25855,7 +25886,7 @@ facilities. @end menu @node Machine Code Insertions,GNAT Implementation of Tasking,,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{41f}@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{178} +@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{422}@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{17b} @section Machine Code Insertions @@ -26023,7 +26054,7 @@ according to normal visibility rules. In particular if there is no qualification is required. @node GNAT Implementation of Tasking,GNAT Implementation of Shared Passive Packages,Machine Code Insertions,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{420}@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{421} +@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{423}@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{424} @section GNAT Implementation of Tasking @@ -26039,7 +26070,7 @@ to compliance with the Real-Time Systems Annex. @end menu @node Mapping Ada Tasks onto the Underlying Kernel Threads,Ensuring Compliance with the Real-Time Annex,,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{422}@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{423} +@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{425}@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{426} @subsection Mapping Ada Tasks onto the Underlying Kernel Threads @@ -26108,7 +26139,7 @@ support this functionality when the parent contains more than one task. @geindex Forking a new process @node Ensuring Compliance with the Real-Time Annex,Support for Locking Policies,Mapping Ada Tasks onto the Underlying Kernel Threads,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{424}@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{425} +@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{427}@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{428} @subsection Ensuring Compliance with the Real-Time Annex @@ -26159,7 +26190,7 @@ placed at the end. @c Support_for_Locking_Policies @node Support for Locking Policies,,Ensuring Compliance with the Real-Time Annex,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{426} +@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{429} @subsection Support for Locking Policies @@ -26193,7 +26224,7 @@ then ceiling locking is used. Otherwise, the @code{Ceiling_Locking} policy is ignored. @node GNAT Implementation of Shared Passive Packages,Code Generation for Array Aggregates,GNAT Implementation of Tasking,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{427}@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{428} +@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{42a}@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{42b} @section GNAT Implementation of Shared Passive Packages @@ -26291,7 +26322,7 @@ This is used to provide the required locking semantics for proper protected object synchronization. @node Code Generation for Array Aggregates,The Size of Discriminated Records with Default Discriminants,GNAT Implementation of Shared Passive Packages,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{429}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{42a} +@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{42c}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{42d} @section Code Generation for Array Aggregates @@ -26322,7 +26353,7 @@ component values and static subtypes also lead to simpler code. @end menu @node Static constant aggregates with static bounds,Constant aggregates with unconstrained nominal types,,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{42b}@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{42c} +@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{42e}@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{42f} @subsection Static constant aggregates with static bounds @@ -26369,7 +26400,7 @@ Zero2: constant two_dim := (others => (others => 0)); @end example @node Constant aggregates with unconstrained nominal types,Aggregates with static bounds,Static constant aggregates with static bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{42d}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{42e} +@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{430}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{431} @subsection Constant aggregates with unconstrained nominal types @@ -26384,7 +26415,7 @@ Cr_Unc : constant One_Unc := (12,24,36); @end example @node Aggregates with static bounds,Aggregates with nonstatic bounds,Constant aggregates with unconstrained nominal types,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{42f}@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{430} +@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{432}@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{433} @subsection Aggregates with static bounds @@ -26412,7 +26443,7 @@ end loop; @end example @node Aggregates with nonstatic bounds,Aggregates in assignment statements,Aggregates with static bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{431}@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{432} +@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{434}@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{435} @subsection Aggregates with nonstatic bounds @@ -26423,7 +26454,7 @@ have to be applied to sub-arrays individually, if they do not have statically compatible subtypes. @node Aggregates in assignment statements,,Aggregates with nonstatic bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{433}@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{434} +@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{436}@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{437} @subsection Aggregates in assignment statements @@ -26465,7 +26496,7 @@ a temporary (created either by the front-end or the code generator) and then that temporary will be copied onto the target. @node The Size of Discriminated Records with Default Discriminants,Image Values For Nonscalar Types,Code Generation for Array Aggregates,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{435}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{436} +@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{438}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{439} @section The Size of Discriminated Records with Default Discriminants @@ -26545,7 +26576,7 @@ say) must be consistent, so it is imperative that the object, once created, remain invariant. @node Image Values For Nonscalar Types,Strict Conformance to the Ada Reference Manual,The Size of Discriminated Records with Default Discriminants,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{437}@anchor{gnat_rm/implementation_of_specific_ada_features image-values-for-nonscalar-types}@anchor{438} +@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{43a}@anchor{gnat_rm/implementation_of_specific_ada_features image-values-for-nonscalar-types}@anchor{43b} @section Image Values For Nonscalar Types @@ -26565,7 +26596,7 @@ control of image text is required for some type T, then T’Put_Image should be explicitly specified. @node Strict Conformance to the Ada Reference Manual,,Image Values For Nonscalar Types,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id15}@anchor{439}@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{43a} +@anchor{gnat_rm/implementation_of_specific_ada_features id15}@anchor{43c}@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{43d} @section Strict Conformance to the Ada Reference Manual @@ -26592,7 +26623,7 @@ behavior (although at the cost of a significant performance penalty), so infinite and NaN values are properly generated. @node Implementation of Ada 2012 Features,GNAT language extensions,Implementation of Specific Ada Features,Top -@anchor{gnat_rm/implementation_of_ada_2012_features doc}@anchor{43b}@anchor{gnat_rm/implementation_of_ada_2012_features id1}@anchor{43c}@anchor{gnat_rm/implementation_of_ada_2012_features implementation-of-ada-2012-features}@anchor{14} +@anchor{gnat_rm/implementation_of_ada_2012_features doc}@anchor{43e}@anchor{gnat_rm/implementation_of_ada_2012_features id1}@anchor{43f}@anchor{gnat_rm/implementation_of_ada_2012_features implementation-of-ada-2012-features}@anchor{14} @chapter Implementation of Ada 2012 Features @@ -28758,7 +28789,7 @@ RM References: 4.03.01 (17) @end itemize @node GNAT language extensions,Security Hardening Features,Implementation of Ada 2012 Features,Top -@anchor{gnat_rm/gnat_language_extensions doc}@anchor{43d}@anchor{gnat_rm/gnat_language_extensions gnat-language-extensions}@anchor{43e}@anchor{gnat_rm/gnat_language_extensions id1}@anchor{43f} +@anchor{gnat_rm/gnat_language_extensions doc}@anchor{440}@anchor{gnat_rm/gnat_language_extensions gnat-language-extensions}@anchor{441}@anchor{gnat_rm/gnat_language_extensions id1}@anchor{442} @chapter GNAT language extensions @@ -28789,7 +28820,7 @@ prototyping phase. @end menu @node How to activate the extended GNAT Ada superset,Curated Extensions,,GNAT language extensions -@anchor{gnat_rm/gnat_language_extensions how-to-activate-the-extended-gnat-ada-superset}@anchor{440} +@anchor{gnat_rm/gnat_language_extensions how-to-activate-the-extended-gnat-ada-superset}@anchor{443} @section How to activate the extended GNAT Ada superset @@ -28829,7 +28860,7 @@ for use in playground experiments. @end cartouche @node Curated Extensions,Experimental Language Extensions,How to activate the extended GNAT Ada superset,GNAT language extensions -@anchor{gnat_rm/gnat_language_extensions curated-extensions}@anchor{441}@anchor{gnat_rm/gnat_language_extensions curated-language-extensions}@anchor{69} +@anchor{gnat_rm/gnat_language_extensions curated-extensions}@anchor{444}@anchor{gnat_rm/gnat_language_extensions curated-language-extensions}@anchor{69} @section Curated Extensions @@ -28846,7 +28877,7 @@ for use in playground experiments. @end menu @node Local Declarations Without Block,Conditional when constructs,,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions local-declarations-without-block}@anchor{442} +@anchor{gnat_rm/gnat_language_extensions local-declarations-without-block}@anchor{445} @subsection Local Declarations Without Block @@ -28870,7 +28901,7 @@ Link to the original RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-local-vars-without-block.md} @node Conditional when constructs,Fixed lower bounds for array types and subtypes,Local Declarations Without Block,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions conditional-when-constructs}@anchor{443} +@anchor{gnat_rm/gnat_language_extensions conditional-when-constructs}@anchor{446} @subsection Conditional when constructs @@ -28942,7 +28973,7 @@ Link to the original RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-conditional-when-constructs.rst} @node Fixed lower bounds for array types and subtypes,Prefixed-view notation for calls to primitive subprograms of untagged types,Conditional when constructs,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions fixed-lower-bounds-for-array-types-and-subtypes}@anchor{444} +@anchor{gnat_rm/gnat_language_extensions fixed-lower-bounds-for-array-types-and-subtypes}@anchor{447} @subsection Fixed lower bounds for array types and subtypes @@ -28996,7 +29027,7 @@ Link to the original RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-fixed-lower-bound.rst} @node Prefixed-view notation for calls to primitive subprograms of untagged types,Expression defaults for generic formal functions,Fixed lower bounds for array types and subtypes,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions prefixed-view-notation-for-calls-to-primitive-subprograms-of-untagged-types}@anchor{445} +@anchor{gnat_rm/gnat_language_extensions prefixed-view-notation-for-calls-to-primitive-subprograms-of-untagged-types}@anchor{448} @subsection Prefixed-view notation for calls to primitive subprograms of untagged types @@ -29049,7 +29080,7 @@ Link to the original RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-prefixed-untagged.rst} @node Expression defaults for generic formal functions,String interpolation,Prefixed-view notation for calls to primitive subprograms of untagged types,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions expression-defaults-for-generic-formal-functions}@anchor{446} +@anchor{gnat_rm/gnat_language_extensions expression-defaults-for-generic-formal-functions}@anchor{449} @subsection Expression defaults for generic formal functions @@ -29078,7 +29109,7 @@ Link to the original RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-expression-functions-as-default-for-generic-formal-function-parameters.rst} @node String interpolation,Constrained attribute for generic objects,Expression defaults for generic formal functions,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions string-interpolation}@anchor{447} +@anchor{gnat_rm/gnat_language_extensions string-interpolation}@anchor{44a} @subsection String interpolation @@ -29232,7 +29263,7 @@ Link to the original RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-string-interpolation.md} @node Constrained attribute for generic objects,Static aspect on intrinsic functions,String interpolation,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions constrained-attribute-for-generic-objects}@anchor{448} +@anchor{gnat_rm/gnat_language_extensions constrained-attribute-for-generic-objects}@anchor{44b} @subsection Constrained attribute for generic objects @@ -29240,7 +29271,7 @@ The @code{Constrained} attribute is permitted for objects of generic types. The result indicates whether the corresponding actual is constrained. @node Static aspect on intrinsic functions,,Constrained attribute for generic objects,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions static-aspect-on-intrinsic-functions}@anchor{449} +@anchor{gnat_rm/gnat_language_extensions static-aspect-on-intrinsic-functions}@anchor{44c} @subsection @code{Static} aspect on intrinsic functions @@ -29249,7 +29280,7 @@ and the compiler will evaluate some of these intrinsics statically, in particular the @code{Shift_Left} and @code{Shift_Right} intrinsics. @node Experimental Language Extensions,,Curated Extensions,GNAT language extensions -@anchor{gnat_rm/gnat_language_extensions experimental-language-extensions}@anchor{6a}@anchor{gnat_rm/gnat_language_extensions id2}@anchor{44a} +@anchor{gnat_rm/gnat_language_extensions experimental-language-extensions}@anchor{6a}@anchor{gnat_rm/gnat_language_extensions id2}@anchor{44d} @section Experimental Language Extensions @@ -29264,7 +29295,7 @@ particular the @code{Shift_Left} and @code{Shift_Right} intrinsics. @end menu @node Storage Model,Attribute Super,,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions storage-model}@anchor{44b} +@anchor{gnat_rm/gnat_language_extensions storage-model}@anchor{44e} @subsection Storage Model @@ -29279,7 +29310,7 @@ Here is a link to the full RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-storage-model.rst} @node Attribute Super,Simpler accessibility model,Storage Model,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions attribute-super}@anchor{44c} +@anchor{gnat_rm/gnat_language_extensions attribute-super}@anchor{44f} @subsection Attribute Super @@ -29309,7 +29340,7 @@ Here is a link to the full RFC: @indicateurl{https://github.com/QuentinOchem/ada-spark-rfcs/blob/oop/considered/rfc-oop-super.rst} @node Simpler accessibility model,Case pattern matching,Attribute Super,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions simpler-accessibility-model}@anchor{44d} +@anchor{gnat_rm/gnat_language_extensions simpler-accessibility-model}@anchor{450} @subsection Simpler accessibility model @@ -29322,7 +29353,7 @@ Here is a link to the full RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-simpler-accessibility.md} @node Case pattern matching,Mutably Tagged Types with Size’Class Aspect,Simpler accessibility model,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions case-pattern-matching}@anchor{44e} +@anchor{gnat_rm/gnat_language_extensions case-pattern-matching}@anchor{451} @subsection Case pattern matching @@ -29454,7 +29485,7 @@ Link to the original RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-pattern-matching.rst} @node Mutably Tagged Types with Size’Class Aspect,Generalized Finalization,Case pattern matching,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions mutably-tagged-types-with-size-class-aspect}@anchor{44f} +@anchor{gnat_rm/gnat_language_extensions mutably-tagged-types-with-size-class-aspect}@anchor{452} @subsection Mutably Tagged Types with Size’Class Aspect @@ -29494,7 +29525,7 @@ Link to the original RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/topic/rfc-finally/considered/rfc-class-size.md} @node Generalized Finalization,,Mutably Tagged Types with Size’Class Aspect,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions generalized-finalization}@anchor{450} +@anchor{gnat_rm/gnat_language_extensions generalized-finalization}@anchor{453} @subsection Generalized Finalization @@ -29522,13 +29553,11 @@ procedure Finalize (Obj : in out Ctrl); procedure Initialize (Obj : in out Ctrl); @end example -As of this writing, the RFC is implemented except for the @cite{No_Raise} aspect. - Link to the original RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/topic/finalization-rehaul/considered/rfc-generalized-finalization.md} @node Security Hardening Features,Obsolescent Features,GNAT language extensions,Top -@anchor{gnat_rm/security_hardening_features doc}@anchor{451}@anchor{gnat_rm/security_hardening_features id1}@anchor{452}@anchor{gnat_rm/security_hardening_features security-hardening-features}@anchor{15} +@anchor{gnat_rm/security_hardening_features doc}@anchor{454}@anchor{gnat_rm/security_hardening_features id1}@anchor{455}@anchor{gnat_rm/security_hardening_features security-hardening-features}@anchor{15} @chapter Security Hardening Features @@ -29550,7 +29579,7 @@ change. @end menu @node Register Scrubbing,Stack Scrubbing,,Security Hardening Features -@anchor{gnat_rm/security_hardening_features register-scrubbing}@anchor{453} +@anchor{gnat_rm/security_hardening_features register-scrubbing}@anchor{456} @section Register Scrubbing @@ -29586,7 +29615,7 @@ programming languages, see @cite{Using the GNU Compiler Collection (GCC)}. @c Stack Scrubbing: @node Stack Scrubbing,Hardened Conditionals,Register Scrubbing,Security Hardening Features -@anchor{gnat_rm/security_hardening_features stack-scrubbing}@anchor{454} +@anchor{gnat_rm/security_hardening_features stack-scrubbing}@anchor{457} @section Stack Scrubbing @@ -29730,7 +29759,7 @@ Bar_Callable_Ptr. @c Hardened Conditionals: @node Hardened Conditionals,Hardened Booleans,Stack Scrubbing,Security Hardening Features -@anchor{gnat_rm/security_hardening_features hardened-conditionals}@anchor{455} +@anchor{gnat_rm/security_hardening_features hardened-conditionals}@anchor{458} @section Hardened Conditionals @@ -29820,7 +29849,7 @@ be used with other programming languages supported by GCC. @c Hardened Booleans: @node Hardened Booleans,Control Flow Redundancy,Hardened Conditionals,Security Hardening Features -@anchor{gnat_rm/security_hardening_features hardened-booleans}@anchor{456} +@anchor{gnat_rm/security_hardening_features hardened-booleans}@anchor{459} @section Hardened Booleans @@ -29881,7 +29910,7 @@ and more details on that attribute, see @cite{Using the GNU Compiler Collection @c Control Flow Redundancy: @node Control Flow Redundancy,,Hardened Booleans,Security Hardening Features -@anchor{gnat_rm/security_hardening_features control-flow-redundancy}@anchor{457} +@anchor{gnat_rm/security_hardening_features control-flow-redundancy}@anchor{45a} @section Control Flow Redundancy @@ -30049,7 +30078,7 @@ see @cite{Using the GNU Compiler Collection (GCC)}. These options can be used with other programming languages supported by GCC. @node Obsolescent Features,Compatibility and Porting Guide,Security Hardening Features,Top -@anchor{gnat_rm/obsolescent_features doc}@anchor{458}@anchor{gnat_rm/obsolescent_features id1}@anchor{459}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{16} +@anchor{gnat_rm/obsolescent_features doc}@anchor{45b}@anchor{gnat_rm/obsolescent_features id1}@anchor{45c}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{16} @chapter Obsolescent Features @@ -30068,7 +30097,7 @@ compatibility purposes. @end menu @node pragma No_Run_Time,pragma Ravenscar,,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id2}@anchor{45a}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{45b} +@anchor{gnat_rm/obsolescent_features id2}@anchor{45d}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{45e} @section pragma No_Run_Time @@ -30081,7 +30110,7 @@ preferred usage is to use an appropriately configured run-time that includes just those features that are to be made accessible. @node pragma Ravenscar,pragma Restricted_Run_Time,pragma No_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id3}@anchor{45c}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{45d} +@anchor{gnat_rm/obsolescent_features id3}@anchor{45f}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{460} @section pragma Ravenscar @@ -30090,7 +30119,7 @@ The pragma @code{Ravenscar} has exactly the same effect as pragma is part of the new Ada 2005 standard. @node pragma Restricted_Run_Time,pragma Task_Info,pragma Ravenscar,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id4}@anchor{45e}@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{45f} +@anchor{gnat_rm/obsolescent_features id4}@anchor{461}@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{462} @section pragma Restricted_Run_Time @@ -30100,7 +30129,7 @@ preferred since the Ada 2005 pragma @code{Profile} is intended for this kind of implementation dependent addition. @node pragma Task_Info,package System Task_Info s-tasinf ads,pragma Restricted_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id5}@anchor{460}@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{461} +@anchor{gnat_rm/obsolescent_features id5}@anchor{463}@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{464} @section pragma Task_Info @@ -30126,7 +30155,7 @@ in the spec of package System.Task_Info in the runtime library. @node package System Task_Info s-tasinf ads,,pragma Task_Info,Obsolescent Features -@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{462}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{463} +@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{465}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{466} @section package System.Task_Info (@code{s-tasinf.ads}) @@ -30136,7 +30165,7 @@ to support the @code{Task_Info} pragma. The predefined Ada package standard replacement for GNAT’s @code{Task_Info} functionality. @node Compatibility and Porting Guide,GNU Free Documentation License,Obsolescent Features,Top -@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{464}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{17}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{465} +@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{467}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{17}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{468} @chapter Compatibility and Porting Guide @@ -30158,7 +30187,7 @@ applications developed in other Ada environments. @end menu @node Writing Portable Fixed-Point Declarations,Compatibility with Ada 83,,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{466}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{467} +@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{469}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{46a} @section Writing Portable Fixed-Point Declarations @@ -30280,7 +30309,7 @@ If you follow this scheme you will be guaranteed that your fixed-point types will be portable. @node Compatibility with Ada 83,Compatibility between Ada 95 and Ada 2005,Writing Portable Fixed-Point Declarations,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{468}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{469} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{46b}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{46c} @section Compatibility with Ada 83 @@ -30308,7 +30337,7 @@ following subsections treat the most likely issues to be encountered. @end menu @node Legal Ada 83 programs that are illegal in Ada 95,More deterministic semantics,,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{46a}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{46b} +@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{46d}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{46e} @subsection Legal Ada 83 programs that are illegal in Ada 95 @@ -30408,7 +30437,7 @@ the fix is usually simply to add the @code{(<>)} to the generic declaration. @end itemize @node More deterministic semantics,Changed semantics,Legal Ada 83 programs that are illegal in Ada 95,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{46c}@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{46d} +@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{46f}@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{470} @subsection More deterministic semantics @@ -30436,7 +30465,7 @@ which open select branches are executed. @end itemize @node Changed semantics,Other language compatibility issues,More deterministic semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{46e}@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{46f} +@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{471}@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{472} @subsection Changed semantics @@ -30478,7 +30507,7 @@ covers only the restricted range. @end itemize @node Other language compatibility issues,,Changed semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{470}@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{471} +@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{473}@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{474} @subsection Other language compatibility issues @@ -30511,7 +30540,7 @@ include @code{pragma Interface} and the floating point type attributes @end itemize @node Compatibility between Ada 95 and Ada 2005,Implementation-dependent characteristics,Compatibility with Ada 83,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{472}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{473} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{475}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{476} @section Compatibility between Ada 95 and Ada 2005 @@ -30583,7 +30612,7 @@ can declare a function returning a value from an anonymous access type. @end itemize @node Implementation-dependent characteristics,Compatibility with Other Ada Systems,Compatibility between Ada 95 and Ada 2005,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{474}@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{475} +@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{477}@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{478} @section Implementation-dependent characteristics @@ -30606,7 +30635,7 @@ transition from certain Ada 83 compilers. @end menu @node Implementation-defined pragmas,Implementation-defined attributes,,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{476}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{477} +@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{479}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{47a} @subsection Implementation-defined pragmas @@ -30628,7 +30657,7 @@ avoiding compiler rejection of units that contain such pragmas; they are not relevant in a GNAT context and hence are not otherwise implemented. @node Implementation-defined attributes,Libraries,Implementation-defined pragmas,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{478}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{479} +@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{47b}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{47c} @subsection Implementation-defined attributes @@ -30642,7 +30671,7 @@ Ada 83, GNAT supplies the attributes @code{Bit}, @code{Machine_Size} and @code{Type_Class}. @node Libraries,Elaboration order,Implementation-defined attributes,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{47a}@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{47b} +@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{47d}@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{47e} @subsection Libraries @@ -30671,7 +30700,7 @@ be preferable to retrofit the application using modular types. @end itemize @node Elaboration order,Target-specific aspects,Libraries,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{47c}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{47d} +@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{47f}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{480} @subsection Elaboration order @@ -30707,7 +30736,7 @@ pragmas either globally (as an effect of the `-gnatE' switch) or locally @end itemize @node Target-specific aspects,,Elaboration order,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{47e}@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{47f} +@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{481}@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{482} @subsection Target-specific aspects @@ -30720,10 +30749,10 @@ on the robustness of the original design. Moreover, Ada 95 (and thus Ada 2005 and Ada 2012) are sometimes incompatible with typical Ada 83 compiler practices regarding implicit packing, the meaning of the Size attribute, and the size of access values. -GNAT’s approach to these issues is described in @ref{480,,Representation Clauses}. +GNAT’s approach to these issues is described in @ref{483,,Representation Clauses}. @node Compatibility with Other Ada Systems,Representation Clauses,Implementation-dependent characteristics,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{481}@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{482} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{484}@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{485} @section Compatibility with Other Ada Systems @@ -30766,7 +30795,7 @@ far beyond this minimal set, as described in the next section. @end itemize @node Representation Clauses,Compatibility with HP Ada 83,Compatibility with Other Ada Systems,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{483}@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{480} +@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{486}@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{483} @section Representation Clauses @@ -30859,7 +30888,7 @@ with thin pointers. @end itemize @node Compatibility with HP Ada 83,,Representation Clauses,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{484}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{485} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{487}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{488} @section Compatibility with HP Ada 83 @@ -30889,7 +30918,7 @@ extension of package System. @end itemize @node GNU Free Documentation License,Index,Compatibility and Porting Guide,Top -@anchor{share/gnu_free_documentation_license doc}@anchor{486}@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{487} +@anchor{share/gnu_free_documentation_license doc}@anchor{489}@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{48a} @chapter GNU Free Documentation License diff --git a/gcc/ada/libgnat/a-except.adb b/gcc/ada/libgnat/a-except.adb index 61cd2569250..fef79f62dad 100644 --- a/gcc/ada/libgnat/a-except.adb +++ b/gcc/ada/libgnat/a-except.adb @@ -482,6 +482,8 @@ package body Ada.Exceptions is (File : System.Address; Line : Integer); procedure Rcheck_PE_Potentially_Blocking_Operation (File : System.Address; Line : Integer); + procedure Rcheck_PE_Raise_Check + (File : System.Address; Line : Integer); procedure Rcheck_PE_Stubbed_Subprogram_Called (File : System.Address; Line : Integer); procedure Rcheck_PE_Unchecked_Union_Restriction @@ -574,6 +576,8 @@ package body Ada.Exceptions is "__gnat_rcheck_PE_Overlaid_Controlled_Object"); pragma Export (C, Rcheck_PE_Potentially_Blocking_Operation, "__gnat_rcheck_PE_Potentially_Blocking_Operation"); + pragma Export (C, Rcheck_PE_Raise_Check, + "__gnat_rcheck_PE_Raise_Check"); pragma Export (C, Rcheck_PE_Stream_Operation_Not_Allowed, "__gnat_rcheck_PE_Stream_Operation_Not_Allowed"); pragma Export (C, Rcheck_PE_Stubbed_Subprogram_Called, @@ -632,6 +636,7 @@ package body Ada.Exceptions is pragma No_Return (Rcheck_PE_Non_Transportable_Actual); pragma No_Return (Rcheck_PE_Overlaid_Controlled_Object); pragma No_Return (Rcheck_PE_Potentially_Blocking_Operation); + pragma No_Return (Rcheck_PE_Raise_Check); pragma No_Return (Rcheck_PE_Stream_Operation_Not_Allowed); pragma No_Return (Rcheck_PE_Stubbed_Subprogram_Called); pragma No_Return (Rcheck_PE_Unchecked_Union_Restriction); @@ -710,6 +715,8 @@ package body Ada.Exceptions is "expected_throw"); pragma Machine_Attribute (Rcheck_PE_Potentially_Blocking_Operation, "expected_throw"); + pragma Machine_Attribute (Rcheck_PE_Raise_Check, + "expected_throw"); pragma Machine_Attribute (Rcheck_PE_Stream_Operation_Not_Allowed, "expected_throw"); pragma Machine_Attribute (Rcheck_PE_Stubbed_Subprogram_Called, @@ -877,6 +884,7 @@ package body Ada.Exceptions is Rmsg_35 : constant String := "object too large" & NUL; Rmsg_36 : constant String := "stream operation not allowed" & NUL; Rmsg_37 : constant String := "build-in-place mismatch" & NUL; + Rmsg_38 : constant String := "raise check failed" & NUL; --------- -- AAA -- @@ -1575,6 +1583,13 @@ package body Ada.Exceptions is Raise_Program_Error_Msg (File, Line, Rmsg_28'Address); end Rcheck_PE_Potentially_Blocking_Operation; + procedure Rcheck_PE_Raise_Check + (File : System.Address; Line : Integer) + is + begin + Raise_Program_Error_Msg (File, Line, Rmsg_38'Address); + end Rcheck_PE_Raise_Check; + procedure Rcheck_PE_Stream_Operation_Not_Allowed (File : System.Address; Line : Integer) is diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index 9e77bf16ff3..181b0d4c125 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -1494,6 +1494,7 @@ begin | Pragma_No_Elaboration_Code_All | Pragma_No_Heap_Finalization | Pragma_No_Inline + | Pragma_No_Raise | Pragma_No_Return | Pragma_No_Run_Time | Pragma_Interrupts_System_By_Default diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 171e516bf3d..55b0a7a5ccf 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -17903,6 +17903,27 @@ package body Sem_Ch13 is Next (Assoc); end loop; + + -- If Relaxed_Finalization is set, the Finalize and Adjust procedures + -- are considered as having the No_Raise aspect specified. + + if Has_Relaxed_Finalization (Typ) + and then Serious_Errors_Detected = 0 + then + Assoc := First (Component_Associations (Aggr)); + while Present (Assoc) loop + Nam := First (Choices (Assoc)); + Exp := Expression (Assoc); + + if Chars (Nam) in Name_Adjust | Name_Finalize then + pragma Assert (Is_Entity_Name (Exp)); + Set_No_Raise (Entity (Exp)); + end if; + + Next (Assoc); + end loop; + end if; + end Validate_Finalizable_Aspect; ------------------------------ diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index e41fb2f8618..3a0572c5a00 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -20807,6 +20807,81 @@ package body Sem_Prag is GNAT_Pragma; Process_Inline (Suppressed); + -------------- + -- No_Raise -- + -------------- + + -- pragma No_Raise (procedure_LOCAL_NAME {, procedure_LOCAL_NAME}); + + when Pragma_No_Raise => Prag_No_Raise : declare + Arg : Node_Id; + Assoc : Node_Id; + Subp : Entity_Id; + + begin + GNAT_Pragma; + Check_No_Identifiers; + Check_At_Least_N_Arguments (1); + + Assoc := Arg1; + while Present (Assoc) loop + Arg := Get_Pragma_Arg (Assoc); + Analyze (Arg); + + if Is_Entity_Name (Arg) then + Subp := Entity (Arg); + + -- If previous error, avoid cascaded errors + + if Subp = Any_Id then + Check_Error_Detected; + + -- The argument must be a [generic] subprogram + + elsif not Is_Subprogram_Or_Generic_Subprogram (Subp) then + Error_Pragma_Arg + ("argument for pragma% must be a subprogram", Assoc); + + -- The argument must be in current scope + + elsif Scope (Subp) = Current_Scope then + Check_Duplicate_Pragma (Subp); + Record_Rep_Item (Subp, N); + + Set_No_Raise (Subp); + + -- For the pragma case, climb homonym chain. This is + -- what implements allowing the pragma in the renaming + -- case, with the result applying to the ancestors, and + -- allows No_Raise to apply to all previous homonyms. + + if not From_Aspect_Specification (N) then + while Present (Homonym (Subp)) + and then Scope (Homonym (Subp)) = Current_Scope + loop + Subp := Homonym (Subp); + Set_No_Raise (Subp); + end loop; + end if; + + -- If entity in not in current scope it may be the enclosing + -- subprogram body to which the aspect applies. + + elsif Subp = Current_Scope + and then From_Aspect_Specification (N) + then + Set_No_Raise (Subp); + + else + Error_Pragma_Arg + ("expect local subprogram name for pragma%", Assoc); + end if; + end if; + + Next (Assoc); + end loop; + end Prag_No_Raise; + --------------- -- No_Return -- --------------- @@ -32769,6 +32844,7 @@ package body Sem_Prag is Pragma_No_Elaboration_Code_All => 0, Pragma_No_Heap_Finalization => 0, Pragma_No_Inline => 0, + Pragma_No_Raise => 0, Pragma_No_Return => 0, Pragma_No_Run_Time => -1, Pragma_Interrupts_System_By_Default => 0, diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index eb4eca0cf7d..3ed4d3a6caa 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -622,6 +622,7 @@ package Snames is Name_No_Caching : constant Name_Id := N + $; -- GNAT Name_No_Elaboration_Code_All : constant Name_Id := N + $; -- GNAT Name_No_Inline : constant Name_Id := N + $; -- GNAT + Name_No_Raise : constant Name_Id := N + $; -- GNAT Name_No_Return : constant Name_Id := N + $; -- Ada 05 Name_No_Tagged_Streams : constant Name_Id := N + $; -- GNAT Name_Obsolescent : constant Name_Id := N + $; -- GNAT @@ -1253,6 +1254,7 @@ package Snames is Name_Container_Checks : constant Name_Id := N + $; -- GNAT Name_Tampering_Check : constant Name_Id := N + $; -- GNAT Name_Tasking_Check : constant Name_Id := N + $; + Name_Raise_Check : constant Name_Id := N + $; -- GNAT Name_All_Checks : constant Name_Id := N + $; Last_Check_Name : constant Name_Id := N + $; @@ -1911,6 +1913,7 @@ package Snames is Pragma_No_Caching, Pragma_No_Elaboration_Code_All, Pragma_No_Inline, + Pragma_No_Raise, Pragma_No_Return, Pragma_No_Tagged_Streams, Pragma_Obsolescent, diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads index 4fd75d46787..97fbbf42d70 100644 --- a/gcc/ada/types.ads +++ b/gcc/ada/types.ads @@ -705,11 +705,12 @@ package Types is Container_Checks : constant := 26; Tampering_Check : constant := 27; Tasking_Check : constant := 28; + Raise_Check : constant := 29; -- Values used to represent individual predefined checks (including the -- setting of Atomic_Synchronization, which is implemented internally using -- a "check" whose name is Atomic_Synchronization). - All_Checks : constant := 29; + All_Checks : constant := 30; -- Value used to represent All_Checks value subtype Predefined_Check_Id is Check_Id range 1 .. All_Checks; @@ -946,7 +947,8 @@ package Types is SE_Infinite_Recursion, -- 34 SE_Object_Too_Large, -- 35 PE_Stream_Operation_Not_Allowed, -- 36 - PE_Build_In_Place_Mismatch); -- 37 + PE_Build_In_Place_Mismatch, -- 37 + PE_Raise_Check_Failed); -- 38 pragma Convention (C, RT_Exception_Code); Last_Reason_Code : constant := @@ -956,7 +958,7 @@ package Types is type Reason_Kind is (CE_Reason, PE_Reason, SE_Reason); -- Categorization of reason codes by exception raised - Rkind : constant array (RT_Exception_Code range <>) of Reason_Kind := + Rkind : constant array (RT_Exception_Code) of Reason_Kind := (CE_Access_Check_Failed => CE_Reason, CE_Access_Parameter_Is_Null => CE_Reason, CE_Discriminant_Check_Failed => CE_Reason, @@ -978,6 +980,7 @@ package Types is PE_Aliased_Parameters => PE_Reason, PE_All_Guards_Closed => PE_Reason, PE_Bad_Predicated_Generic_Type => PE_Reason, + PE_Build_In_Place_Mismatch => PE_Reason, PE_Current_Task_In_Entry_Body => PE_Reason, PE_Duplicated_Entry_Address => PE_Reason, PE_Explicit_Raise => PE_Reason, @@ -985,13 +988,13 @@ package Types is PE_Implicit_Return => PE_Reason, PE_Misaligned_Address_Value => PE_Reason, PE_Missing_Return => PE_Reason, + PE_Non_Transportable_Actual => PE_Reason, PE_Overlaid_Controlled_Object => PE_Reason, PE_Potentially_Blocking_Operation => PE_Reason, + PE_Raise_Check_Failed => PE_Reason, + PE_Stream_Operation_Not_Allowed => PE_Reason, PE_Stubbed_Subprogram_Called => PE_Reason, PE_Unchecked_Union_Restriction => PE_Reason, - PE_Non_Transportable_Actual => PE_Reason, - PE_Stream_Operation_Not_Allowed => PE_Reason, - PE_Build_In_Place_Mismatch => PE_Reason, SE_Empty_Storage_Pool => SE_Reason, SE_Explicit_Raise => SE_Reason, diff --git a/gcc/ada/types.h b/gcc/ada/types.h index 9bfbdfca00b..3193f01444c 100644 --- a/gcc/ada/types.h +++ b/gcc/ada/types.h @@ -432,7 +432,8 @@ enum RT_Exception_Code SE_Infinite_Recursion = 34, SE_Object_Too_Large = 35, PE_Stream_Operation_Not_Allowed = 36, - PE_Build_In_Place_Mismatch = 37 + PE_Build_In_Place_Mismatch = 37, + PE_Raise_Check_Failed = 38 }; -#define LAST_REASON_CODE 37 +#define LAST_REASON_CODE 38 From patchwork Fri Aug 2 07:11:23 2024 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: 95161 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 DB030385F024 for ; Fri, 2 Aug 2024 07:15:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id D7B2A385DDEC for ; Fri, 2 Aug 2024 07:12:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D7B2A385DDEC Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D7B2A385DDEC Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::332 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582752; cv=none; b=At3tNB0TwwAONn83D7ytrVMDL09nLMFwcUzfTBpEIvyo/kJc3n1Dq+40b9cGBE8tEabQwRwddZqiIEnL024CR3rgdwzgPs8yZKwtP1Wxw40D4eKwhlNB93XhXkGW6MrY1Z/IuiSd3yiITrXmqKUdbMwq2xVBWWsmqxBYSpSCOkw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582752; c=relaxed/simple; bh=pnBdYEnt5oj4WPxqXCTBZkscWRvaDQv+WFdAkYWUes0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=c8y/Vc+jTdVsSXvWgXN7PAF7QAylRLxx6fSHqBgX8UPD6oNfe0+UgbFxZtkt/EPTnhwIwGTYDXLHwQ532wEierRlqJeWxlvfnLe2BmcOAbw2WaWqaMTM2M/GGRi9zSd27uXlEnMYAcaCOzxk9aK1fRx2f7gXwk8ErOEhvfj3SYQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-428101fa30aso51835405e9.3 for ; Fri, 02 Aug 2024 00:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582748; x=1723187548; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x9U92FE99DnPn+nsnQEY3jN2NojvThnVuJLLJAKWhnc=; b=eCCO6aozz3st/RiyIvaoC8H6C45eFKZ/2X9J++vhQrgUxEWSw2ZZkAaUCtY5N2cpHv UoyppKBDE6+b63TnSPPXAVzl3oPHFQLwTxFCQEWvY+DhCP5vp5nuC87GE3s/5cHq1qWK 34E6bLhYcO/6qvEA4tXSJxOrPUAKT7lF1rdLNJNPxKCJq3uqrc2MkutYo86OeWclVl4a IEkBoGusBvnjwNShuRB6pDVnsLdPYvM1IVURV1xzly2Kv56RqWamsYiML/pwMRdxPV2z RMaaSag7mQTeYIL1Ti5BDxA6+D6umyqiJ1vg/sz/qQCWw9nO2Oy1b6Wi0nLMSkHCQJg6 Asng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582748; x=1723187548; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x9U92FE99DnPn+nsnQEY3jN2NojvThnVuJLLJAKWhnc=; b=VMOTYwmK7JQ8aRe+W9wpKrKukfsKRJ3DDGP9ZwruYYT7tNVNINPi/b9He58o9XquSx cERwW/u0SVezlri00IjUvXLtpJwwcOairn2qHhH47x0CQgFBaVyw/uL2eMmhkMKdlMi9 7p3Ngk15uK4qV4cFy8CiOxZbg4a2n9eoULtxoBEpPxjj4g5k/wE0cZ0h365T98hjPiPe WlCPLvjr6Upud31Ks+MoeKCuR2XcH7F9gx018nrLGHkz52/dTFsCX2xmm6F75yQ5pLKa kyrhpOUFC9m31SscQ7PHqBdTaK0HiI0w5nc86uRwrUjqolBPl72t0IOB5CxIxQaEB/Ng wjWw== X-Gm-Message-State: AOJu0YydA4g3B5fNnxE6AGE1N99vClb7U+yOv+23BrG+EZNBylVOF/qV T2hQsqmAzERNqQ5o5xYLvrZ0kjMOhOjLgvCoj6dattaepkY/mdxg+m0U2jDb/seFRbFK/VKY3Ha o8w== X-Google-Smtp-Source: AGHT+IEivKlnBiouQucwGj/IrcaRnC8eGywayREDy7IVuVNoG/B3RIx2v8zSF5QKNoZJ5zos8KLuVQ== X-Received: by 2002:a05:600c:1e24:b0:427:abf6:f0e6 with SMTP id 5b1f17b1804b1-428e6af4e15mr15876635e9.9.1722582747717; Fri, 02 Aug 2024 00:12:27 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:27 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Steve Baird Subject: [COMMITTED 06/26] ada: Type conversion in instance incorrectly rejected. Date: Fri, 2 Aug 2024 09:11:23 +0200 Message-ID: <20240802071210.413366-6-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Steve Baird In some cases, a legal type conversion in a generic package is correctly accepted but the corresponding type conversion in an instance of the generic is incorrectly rejected. gcc/ada/ * sem_res.adb (Valid_Conversion): Test In_Instance instead of In_Instance_Body. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_res.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 8a18430ff58..9a3b6ddbb53 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -14697,7 +14697,7 @@ package body Sem_Res is -- If it was legal in the generic, it's legal in the instance - elsif In_Instance_Body then + elsif In_Instance then return True; -- Ignore privacy for streaming or Put_Image routines From patchwork Fri Aug 2 07:11:24 2024 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: 95162 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 2D308385E45A for ; Fri, 2 Aug 2024 07:15:12 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 0D3183858D3C for ; Fri, 2 Aug 2024 07:12:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0D3183858D3C Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0D3183858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582752; cv=none; b=LnBft0aPKzHX/LbIuT/yvOimi1Bd//SOkagUmYDGERJUdROL9XXWbGdwApVMQLDY0MIgzKhD8h4orylx0jEzN5ju8dr4RA9s8NYBv9XvA/zwZDpexRna9plSOcxRW2CwZnEuAPxffyCV5AV5pmamr4sYfHwMi1by/DBacniAQCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582752; c=relaxed/simple; bh=qxINkfdchADXDAsTzgXPkAsjsgnEY8XJQmYMUu3k1Ec=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=KieOsLZ5+HkcxF1x8TQambufZ7BHL7KGZitaYX4Z1P8bVak5n3kwy/Op/+hC01VH985YsErQVRZZTY6o8dQ57173AvC3LrPw3WT1arKRQVygqK0T2cGSDpL6HshIU6xr6kZskHH1kP591L6Ahde3v/Gs0oxNI1/GCmbhlnoZBE8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3685a5e7d3cso4529962f8f.1 for ; Fri, 02 Aug 2024 00:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582749; x=1723187549; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tDHDuJR7Wmt5coy6ZrPebG/HZaqtrjsHUYbBw/gu2r8=; b=HJHNP2sEMnBDiGMh1EYrXnYDf2aBgGw2Sl4zyr+Qcf6zmE58hk8R69XKJMI0wNYQmT XIfkOoGka0Be9Oq57nSl7cyQ/8HSpHFzOrp+5slkT9n2vJ65ptDCUELAJK1jEEfe0cog 2cf+jOfKPJDeSnLJ/5JNa0KL69famTRYa+mwzH9RLsi4WeY+EctZPWRWOZVf4VDuQIY9 ROIUSjcuOjh7apuF+WWSzRzfmKPswquc/aoMsywaKy4sQIKtB6zVvGdQrI8Ff0NUSA5S PUndZkR1tUEjdp1lt+PxqdS8zi0IttBkgGitLG55wjyXSie7EflLsL6KKc4QUzHBw5me +/Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582749; x=1723187549; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tDHDuJR7Wmt5coy6ZrPebG/HZaqtrjsHUYbBw/gu2r8=; b=n+F+wQ/Jud4WcwmHW9a7X5Ol9iDosv1xX1D+iPpa0SHl3W+8fw7o2Umis1mCAVKWa/ mW6yZ8kl8bMauFFbbeHG3jNz9sjJkT+/czEd0QpOIl3FF8zj1FfXyRoTrt2LPvhVl+Di gKhhumCzMeLQZA+4tM7FRBzcNk+/tOSHljAsLI/MYy/YVOB1sugrzXqlo9o8K8l29Bx2 RIvQqpg4WNEWCY4J3cOB6OroHYDZGyyBrmAqCz/8c/Oi1VH1Br4tyQk7QBoJFvyzAA55 pchhymzzqjGCKlI5xncKFtpuuQ+qYsdkfJDHFzplwZ1O0hMnKeRu32Y9Z8HHi3XKUuKF Fw0A== X-Gm-Message-State: AOJu0YxZYBB+PRYnXUlNW/nlXIG5PM/EPaxyNmins1zsFGyQhH/aleEm ZjGZ5T8t7EC4eyNcUMtZQ5zSvYkFpSJ8JZFX+nnldqGvp5LUGayiNlhgK8qRkxB+M/HHi1UEiAn KSg== X-Google-Smtp-Source: AGHT+IHd9qhNAqWd3efzfW1i85MyvPkh1n44nCZfiTqBirBnQIDNl80Z80Ho3SnPYiTOiurdN2tFwQ== X-Received: by 2002:adf:f488:0:b0:362:8201:fa3 with SMTP id ffacd0b85a97d-36bbc12e30cmr1584829f8f.34.1722582748586; Fri, 02 Aug 2024 00:12:28 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:28 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Steve Baird Subject: [COMMITTED 07/26] ada: Reject illegal uses of type/subtype current instance Date: Fri, 2 Aug 2024 09:11:24 +0200 Message-ID: <20240802071210.413366-7-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Steve Baird The current instance of a type or subtype (see RM 8.6) is an object or value, not a type or subtype. So a name denoting such a current instance is illegal in any context that requires a name denoting a type or subtype. In some cases this error was not detected. gcc/ada/ * sem_ch8.adb (Find_Type): If Is_Current_Instance returns True for N (and Comes_From_Source (N) is also True) then flag an error. Call Is_Current_Instance (twice) instead of duplicating (twice) N_Access_Definition-related code in Is_Current_Instance. * sem_util.adb (Is_Current_Instance): Implement access-type-related clauses of the RM 8.6 current instance rule. For pragmas Predicate and Predicate_Failure, distinguish between the first and subsequent pragma arguments. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch8.adb | 24 ++++++++++++++---------- gcc/ada/sem_util.adb | 31 ++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index d2752af320e..c77a69e5118 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -8801,6 +8801,16 @@ package body Sem_Ch8 is Error_Msg_NE ("\\found & declared#", N, T_Name); Set_Entity (N, Any_Type); + elsif Is_Current_Instance (N) and then Comes_From_Source (N) then + if Nkind (Parent (T_Name)) = N_Subtype_Declaration then + Error_Msg_N ("reference to current instance of subtype" & + " does not denote a subtype (RM 8.6)", N); + else + Error_Msg_N ("reference to current instance of type" & + " does not denote a type (RM 8.6)", N); + end if; + Set_Entity (N, Any_Type); + else -- If the type is an incomplete type created to handle -- anonymous access components of a record type, then the @@ -8831,12 +8841,9 @@ package body Sem_Ch8 is if In_Open_Scopes (T_Name) then if Ekind (Base_Type (T_Name)) = E_Task_Type then - -- In Ada 2005, a task name can be used in an access - -- definition within its own body. + -- OK if the "current instance" rule does not apply. - if Ada_Version >= Ada_2005 - and then Nkind (Parent (N)) = N_Access_Definition - then + if not Is_Current_Instance (N) then Set_Entity (N, T_Name); Set_Etype (N, T_Name); return; @@ -8849,12 +8856,9 @@ package body Sem_Ch8 is elsif Ekind (Base_Type (T_Name)) = E_Protected_Type then - -- In Ada 2005, a protected name can be used in an access - -- definition within its own body. + -- OK if the "current instance" rule does not apply. - if Ada_Version >= Ada_2005 - and then Nkind (Parent (N)) = N_Access_Definition - then + if not Is_Current_Instance (N) then Set_Entity (N, T_Name); Set_Etype (N, T_Name); return; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 032684f3ddb..7901eb8ee38 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -16080,6 +16080,29 @@ package body Sem_Util is P : Node_Id; begin + -- Since Ada 2005, the "current instance" rule does not apply + -- to a type_mark in an access_definition (RM 8.6), + -- although it does apply in an access_to_object definition. + -- So the rule does not apply in the definition of an anonymous + -- access type, but it does apply in the definition of a named + -- access-to-object type. + -- The rule also does not apply in a designated subprogram profile. + + if Ada_Version >= Ada_2005 then + case Nkind (Parent (N)) is + when N_Access_Definition | N_Access_Function_Definition => + return False; + when N_Parameter_Specification => + if Nkind (Parent (Parent (N))) in + N_Access_To_Subprogram_Definition + then + return False; + end if; + when others => + null; + end case; + end if; + -- Simplest case: entity is a concurrent type and we are currently -- inside the body. This will eventually be expanded into a call to -- Self (for tasks) or _object (for protected objects). @@ -16129,6 +16152,12 @@ package body Sem_Util is elsif Nkind (P) = N_Pragma and then Get_Pragma_Id (P) in Pragma_Predicate | Pragma_Predicate_Failure + + -- For "pragma Predicate (T, Is_OK (T))", return False for the + -- first use of T and True for the second. + + and then + N /= Expression (First (Pragma_Argument_Associations (P))) then declare Arg : constant Entity_Id := @@ -16144,7 +16173,7 @@ package body Sem_Util is end loop; end if; - -- In any other context this is not a current occurrence + -- In any other context this is not a current instance reference. return False; end Is_Current_Instance; From patchwork Fri Aug 2 07:11:25 2024 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: 95164 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 22573385E827 for ; Fri, 2 Aug 2024 07:15:20 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id BB6FA385DDEE for ; Fri, 2 Aug 2024 07:12:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB6FA385DDEE Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BB6FA385DDEE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582752; cv=none; b=WuYnqsk0+tZi0ErIhiDJ+UXzIKUYOElF5sZEboF1iwiHVkrhAvZp2or+6w+VDjTrhK5pka8Qah+a2uORZp8ws0jj3us1ETkYoWdnA7F36jIDoZdWwoW05i9ViMOVDm+x1bfXSAvxlSHrarPZDIxfJdYvejCgPyFv6Dq9TMPbxqU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582752; c=relaxed/simple; bh=p9F3ahqRTCN1Lhpu1LIaE4QWwERwq2OnF2slLzNQ/P4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=oUeb69bIvtrMtTW3mmal0Z6cRiXLbNPau4MA8csChe0DQb27xR7MO4kKAgaGctyngGfz388+jr6nAZ6WK2JOSuLyP7u/R/ndiXED1sSC0dq3ZjWb1A3Tdg3jeIcne7tfK7M9P8ekUGJm2VZeOrIaA95b5ICNUXYAGcNk+GaS8xA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-367963ea053so4945948f8f.2 for ; Fri, 02 Aug 2024 00:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582749; x=1723187549; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AIhrzaVcH8q3XGWIlZgUwjDXaN/TOhOGH49WRdJakwg=; b=e5i3gEwGsENCHdk046ZO5+drI397WVYMbrhmZIglEQiLFUGpOVdhaMbAg9VgcyYZhk ozQPzeH5yQ3C4HW/dMH2tJcWQiyhYRKTdsTW3BzM37jHHRhwb1u4df5i5M47vuoWoEjs HGzcgWSjAz3l+ta+mhEJ7cW5TDqltH6VlZY50Vpft7SoYR4lUehJNklP0jv4kIy8/noX sglu0Ka6j0Kv1zJlYBoz5BMDWCnfaYzeG5e95BHLf475mH70O5QxASJLVOEKgKFzPo8C wc1vFcdiIy56uXf0LD7IKYODsWvqIpUMzQf4MNDk8HNvo8s1cEegsBB5+gltG4PWd14s i71w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582749; x=1723187549; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AIhrzaVcH8q3XGWIlZgUwjDXaN/TOhOGH49WRdJakwg=; b=oAVZ1zgv4gLkeU9UO5N/fIWNBXrodPzZnGc/NSiRcygqDui1Xu+Xmc3RIBLZFf0Sd1 WDm1Up62H0wkZBKdpnu2pdGO+th+DPcp71iCMJdfWwT59kUORpPKFJQOftMK8t8HJEsO iK4k8nw76g3N10oZjDfKJrIfmG7C3AEYkqorfQP710W01tbzQKVWdj4PAzBrUyfZSzdV 0+RN3McfIihOdAtrVsXTEeMnvA1zvPpG6ekhLMv5js2LcGG3TVWe11+5FFOo3rnRK7/A jC+Chfg09EvwwwGUAIRyrDfi1YSQMCStwjdo0NI780nFrIa2PApcMEOEOC8Fyl5vIvdx Dsww== X-Gm-Message-State: AOJu0YzMMfoJoxMFl/LZpiM6HqAKbzWRbOFGE20A2qbewuJLdWoFQPcG pUU9A9uPynRhKRGBki8SXskEOsemDKMQx+iyZmkbn+Qj4gvxz89Tj5vi4JPytlxghiuAfFZRdd5 Q9g== X-Google-Smtp-Source: AGHT+IHxHW78MrU2ivALGu+Eq/rAdtIn4SAIlq8h9i8us929ULyexgiD5/8R3PsXv9tW0jK14QUtOw== X-Received: by 2002:a05:6000:18c1:b0:368:3b5c:7a5d with SMTP id ffacd0b85a97d-36bbc0ff29bmr1652529f8f.20.1722582749377; Fri, 02 Aug 2024 00:12:29 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:28 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED 08/26] ada: Fix handling reference warnings with slices Date: Fri, 2 Aug 2024 09:11:25 +0200 Message-ID: <20240802071210.413366-8-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Viljar Indus gcc/ada/ * sem_util.adb (Set_Referenced_Modified): Set referenced as LHS for the prefixes of array slices. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 7901eb8ee38..7b575c09c30 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -27787,9 +27787,10 @@ package body Sem_Util is Pref : Node_Id; begin - -- Deal with indexed or selected component where prefix is modified + -- Deal with indexed components, selected components, or slices where + -- the prefix is modified. - if Nkind (N) in N_Indexed_Component | N_Selected_Component then + if Nkind (N) in N_Indexed_Component | N_Selected_Component | N_Slice then -- Grab the original node to avoid looking at internally generated -- objects. From patchwork Fri Aug 2 07:11:26 2024 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: 95166 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 3A7BF385E83D for ; Fri, 2 Aug 2024 07:16:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by sourceware.org (Postfix) with ESMTPS id C98F6385E45A for ; Fri, 2 Aug 2024 07:12:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C98F6385E45A Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C98F6385E45A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::233 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582754; cv=none; b=O9836OkYRnrCBnoYMb33zkIsPHuO3WonIJWfnQYeep21vK+OuJhDXgDXzkrDU6m8N+3+JePkRgY1aseVt5+z7BkODXR/HVVy7PjMlAbgjozVl1YR+qRMtmmH0NP0I3feig44bnxlWaGe+sO3RF7GaXBsFu4F6dJHOYBO9CjIg2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582754; c=relaxed/simple; bh=ul77WTuGULC///hd6s4wYYYCMSrUkDxg7wFZNoZGNb0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=CEBbB7heynGF4kWEs/9nKY7xq/wR2oncMYxkge+MNQBrQKjrBVM77kLRnJ/W30bZDuNdJA4Y5CtZR0uX4L+BgnrE1xCvuR00xaFGtQn0hzLKO1tTgny1dYHZIsrTkF46pSEhGWzI4JAsi0Jhk/I6QS/n6PaxVsu0wooup3p/qFY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2ef2c56d9dcso96924281fa.2 for ; Fri, 02 Aug 2024 00:12:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582750; x=1723187550; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Juv2vhUyVEr1Wc5bM5qybMDFqJ0K0NJxttDIpmGPKeA=; b=I2SJ6VNnzqONiuasjQyGAKjgjPii63daNjxiOYX3Vqjg15AB3dDJ/1kXXDq70YYnWI WJEj2vf9b77gyFyu3IwPJdBjWPNakB3S34kzlAsYg0blTScbkrOIhz30xJpQ9zXEO7hK kqQM4Nnv1riA6qbrlQyOYre+lqsgXTFLqLzMunCAe4fGkcdashd4J6XuKJnfCIDz7mX2 0gr4JTfFgUIzdO8ECGgYv7qu+08wo3dCCk/dfDJ3DDySbO840aTvSObeOwsoXoiGb60B 5BXmDdAmtMGc5GXmSfv6bnm3xZEdgd3n6LZfWHgmXyflbMDG4JqLLB60gIps3dvggQ65 9Xtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582750; x=1723187550; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Juv2vhUyVEr1Wc5bM5qybMDFqJ0K0NJxttDIpmGPKeA=; b=vaWfJrWTjCsLvvwku0JF6B3qgFDzNQHbjIvlU76rXuTtfiwGV2GFq3LCfuIm5YGNnI YFp3sYNtneFzVDSC/bY6vJ3Kx8L1Qgh/1BhkIAsLYKDmi5Gg10nhFi0TtcuKwlgnsv81 E4zNR7t+DiAguD3masWMQsI8CPUy6aeISjFcsJZ+pL3hXRqa9GRo4Th/tVjFHuHy5zi4 0ImxSuczgGvEZ2Zyd7cCcWwnkGPJy+DvmIWnDAq3WmhKrqqkkI5+Rf79/OBKCjykZQpC g8MqZPSX8MH/cyBKsMJkMGe7oaQikj0g71czR0Lm5DLLqisemjyHLUKofUg68o0pkE4F BiHw== X-Gm-Message-State: AOJu0YxSGJIdWxY3QVp3N20a68BjOY002qrUWGjW3/O8SrwnU7+FROvR LoU+yT7jauwoVJC/b/usrCJxrJHRZGd9BBZ88YAuMo/7u7Tlj3zTnIUvIp5szj2JDoQ10OwLIxu pFw== X-Google-Smtp-Source: AGHT+IGaiCa1VNcNoVcOmVsQxdF8Mh2JIgly8xaSB1TrRz34gIA7NC52kv2mqjWFD7BOH6pO3ul/8w== X-Received: by 2002:a05:6512:3d18:b0:52c:e03d:dfd7 with SMTP id 2adb3069b0e04-530bb39b0bcmr1586358e87.39.1722582750161; Fri, 02 Aug 2024 00:12:30 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:29 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 09/26] ada: Finish up support for relaxed finalization Date: Fri, 2 Aug 2024 09:11:26 +0200 Message-ID: <20240802071210.413366-9-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou This adds a variant of the System.Finalization_Primitives unit that supports only controlled types with relaxed finalization, and adds the description of its implementation to Exp_Ch7. gcc/ada/ * exp_ch7.adb (Relaxed Finalization): New paragraph in head comment. * sem_ch13.adb (Validate_Finalizable_Aspect): Give an error message if strict finalization is required but not supported by the runtime. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch7.adb | 58 ++++++++++++++++++++++++++++++++++++++++++++ gcc/ada/sem_ch13.adb | 18 +++++++++++--- 2 files changed, 72 insertions(+), 4 deletions(-) diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 044b14ad305..b545a58448d 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -337,6 +337,64 @@ package body Exp_Ch7 is -- directly by the compiler during the expansion of allocators and calls to -- instances of the Unchecked_Deallocation procedure. + -------------------------- + -- Relaxed Finalization -- + -------------------------- + + -- This paragraph describes the differences between the implementation of + -- finalization as specified by the Ada RM (called "strict" and documented + -- in the previous paragraph) and that of finalization as specified by the + -- GNAT RM (called "relaxed") for a second category of controlled objects. + + -- For objects (statically) declared in a scope, the default implementation + -- documented in the previous paragraph is used for the scope as a whole as + -- soon as one controlled object with strict finalization is present in it, + -- including one transient controlled object. Otherwise, that is to say, if + -- all the controlled objects in the scope have relaxed finalization, then + -- no Finalization_Master is built for this scope, and all the objects are + -- finalized explicitly in the reverse order of their creation: + + -- declare + -- X : Ctrl := Init; + -- Y : Ctrl := Init; + + -- begin + -- null; + -- end; + + -- is expanded into: + + -- declare + -- XMN : aliased System.Finalization_Primitives.Master_Node; + -- X : Ctrl := Init; + -- System.Finalization_Primitives.Attach_To_Node + -- (X'address, + -- CtrlFD'unrestricted_access, + -- XMN'unrestricted_access); + -- YMN : aliased System.Finalization_Primitives.Master_Node; + -- Y : Ctrl := Init; + -- System.Finalization_Primitives.Attach_To_Node + -- (Y'address, + -- CtrlFD'unrestricted_access, + -- YMN'unrestricted_access); + + -- procedure _Finalizer is + -- begin + -- Abort_Defer; + -- System.Finalization_Primitives.Finalize_Object (YMN); + -- System.Finalization_Primitives.Finalize_Object (XMN); + -- Abort_Undefer; + -- end _Finalizer; + + -- begin + -- null; + -- end; + -- at end + -- _Finalizer; + + -- Dynamically allocated objects with relaxed finalization need not be + -- finalized and, therefore, are not attached to any finalization chain. + type Final_Primitives is (Initialize_Case, Adjust_Case, Finalize_Case, Address_Case); -- This enumeration type is defined in order to ease sharing code for diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 55b0a7a5ccf..3fb0209f612 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -17907,9 +17907,10 @@ package body Sem_Ch13 is -- If Relaxed_Finalization is set, the Finalize and Adjust procedures -- are considered as having the No_Raise aspect specified. - if Has_Relaxed_Finalization (Typ) - and then Serious_Errors_Detected = 0 - then + if Serious_Errors_Detected > 0 then + null; + + elsif Has_Relaxed_Finalization (Typ) then Assoc := First (Component_Associations (Aggr)); while Present (Assoc) loop Nam := First (Choices (Assoc)); @@ -17922,8 +17923,17 @@ package body Sem_Ch13 is Next (Assoc); end loop; - end if; + -- If Relaxed_Finalization is not set, then check that the support for + -- strict finalization is available in the runtime library. + + elsif not In_Predefined_Unit (Cunit (Get_Source_Unit (Typ))) + and then not RTE_Available (RE_Finalization_Master) + then + Error_Msg_N + ("only Relaxed Finalization is supported in this configuration", + ASN); + end if; end Validate_Finalizable_Aspect; ------------------------------ From patchwork Fri Aug 2 07:11:27 2024 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: 95170 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 050F53860744 for ; Fri, 2 Aug 2024 07:17:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id 8C820385DDCE for ; Fri, 2 Aug 2024 07:12:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C820385DDCE Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8C820385DDCE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::236 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582755; cv=none; b=iLqG2bKQRhm4oNSF05nl1aqSafGXhrJSLuvHlv16KwjMPSX/Q8ecaZ0k8UDSstUIYlVZ5D41h5Xu2g6afupF18P3aoPkVBiMOvHz6JKEzgy2DEgYf1TLehrP0xvJrvEcGKoZg+ltvxWwW8DeNkCOO5kJ6ttYO5/OfkoR0y+5i5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582755; c=relaxed/simple; bh=lcNwtBacVQLuvHeckHwRuQL2gmEC7MzJu7VPJ6+WtVQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fIvoSFMxtQjU5XHNLTJrxikxeJ6OVb6NAvmkbMs5UB3ibsn3idpV19SMW0I60BA57T1CyjOg0tt0OlQ5Esmw7EgWQ/gRS+Fxyhuh4/5qVH6o9WHgy9RrrYC8LjNEh+Bsbs84ecUc/ZC3dDRz90qIDrT+8vuUzSa2o5rQ67xvpF8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2eeb1051360so86518991fa.0 for ; Fri, 02 Aug 2024 00:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582751; x=1723187551; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZR1zRSOFs2pVkCOBxAaCd9kPIdCFVb7aafXgFm7zAJs=; b=RNwapMVSxSGkol2//+ueIc4KfKp9K/meeexAR6FwwWHuMOyxsf++njKnMF9SIU/CU+ 8agiaWplwaTI6rxEk89TO7hHJgW0umz2ccr25FZXTiWfI1lWYs4A+ziQ1GTayMlZiElB yRa3OoBu0g8GhWxkmY2PReVTbb04Ow5EbFq6YKgCrtQYfUd2YqUQq1+xtEjLSU39OOjr w2glklCE+GGe3rSvt+uUQ0EWf2pGz1RkSP4AXCpkTUJWKvNrwBATcH0K6GDgJb5Jk24H D1AsS6kpC6cJULD7UZ7+NQfH+o7avmgD2C8MlXHVmLCI00KtlwEWnZkznpzZq4L+spuR USUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582751; x=1723187551; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZR1zRSOFs2pVkCOBxAaCd9kPIdCFVb7aafXgFm7zAJs=; b=b/qRB7+o2rxlVBvXF0MXEhngWvpvK80vtTywfqnzCuUtVGdf/zN8DwUjd9Dl0Pz4PS 2pUV5wSAxuhSETqQVXt0rEklypc4O43Jl3k2mkn5VUrATc27G4lmblr6IIP0idqUpa/0 ZetrU9ARRa9YHzfaqAgOeldJtl92OAEXxp6Yy3k5UljNJ0hbFMaAdslDJQIjVcUoJM8b BYw21b44JBVyDte4MDvQKG02S0IzvGN2uMQUwMRAMgAt2+kPPhqEgQz/M6gCH+u2WBq+ PFBlDlZdpd/x18O8YTvmymc8Ey2/lixOVWRdHwkqx004O6ms4SXCA0PjZjG/AuoX0NWA 82sg== X-Gm-Message-State: AOJu0Yxr38xrSPKnUVxZwftTtSxYF0XIFfQP+WyJA9XDg/SXUnhe9YK+ 1LARvEHqbQVIf9yXTomEiVeradUbQKKUr28s1f15jbwKcyVw0ER7ngku3KhH/Q2mu/4iSJ9Vlai htg== X-Google-Smtp-Source: AGHT+IEp2l04Dui9gYt+Rnx2i3m3IBgNmds17GtXgWoF10/z1F9dRkjhUpN8undrsN7ggK6GJmLs1Q== X-Received: by 2002:a2e:8885:0:b0:2ef:2575:de11 with SMTP id 38308e7fff4ca-2f15aa91143mr17520601fa.15.1722582750954; Fri, 02 Aug 2024 00:12:30 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:30 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Steve Baird Subject: [COMMITTED 10/26] ada: Compiler accepts illegal assignment to reference type target. Date: Fri, 2 Aug 2024 09:11:27 +0200 Message-ID: <20240802071210.413366-10-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Steve Baird An assignment statement whose LHS is of a reference type is never legal. If no other legality rule is violated, then it is ambiguous. In some cases this ambiguity was not correctly detected. gcc/ada/ * sem_ch5.adb (Analyze_Assignment): Delete code that was incorrectly implementing a preference rule. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch5.adb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 4db3a1a26ee..d44a12d1dd1 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -437,14 +437,6 @@ package body Sem_Ch5 is then null; - -- This may be a call to a parameterless function through an - -- implicit dereference, so discard interpretation as well. - - elsif Is_Entity_Name (Lhs) - and then Has_Implicit_Dereference (It.Typ) - then - null; - elsif Has_Compatible_Type (Rhs, It.Typ) then if T1 = Any_Type then T1 := It.Typ; From patchwork Fri Aug 2 07:11:28 2024 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: 95174 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 2F8A7385DDFA for ; Fri, 2 Aug 2024 07:18:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 47B42385E82D for ; Fri, 2 Aug 2024 07:12:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 47B42385E82D Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 47B42385E82D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::431 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582756; cv=none; b=v9ZV1yTeEcRcpbC5WYfKyytMX8ahZtsVtIuc646Di8qPMFaQnpS662DTjXHRzswpBYqY5Ds1u5/zVur56qJAszwLlLSaNUNeAjZj0B+Qrt0ExJVB/E/gLLlKxvxcPv1gcQRjp93yvFq1S2gSGCMAHx7HBa+LWcu+2flIquWQSzM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582756; c=relaxed/simple; bh=gEO4KWIhvlxVrrk/3eNSRBdMagvkkb67qqxFhajzpLI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WHDnFEcyeAwEC1kNJEGRmDtoQ7bPAQdZOEb+HBFSq8ox/RWlQYC5oJJvRyFhTpd8eSh89c2Rj/dM1r0GsS03uUri0mWXXee2TkJnLMH25Hdmogcg/l7cuZVn4lB0eI79qkRhbEzIkbOabLQNjhvrMNGyRNoWpLaGAFIHhDjiYOM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-36bb2047bf4so799407f8f.2 for ; Fri, 02 Aug 2024 00:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582752; x=1723187552; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mJAOm0hvehT/2l40ba1HUH5JT1kIkS6/KCgAYoFQhN4=; b=fh5eFxEwA1nO3NQDPN4Mj/Zsmz/yn/rI7YxW2VTsblddS12RqjjaBITTsa7Fz/NVFR lcKAz9ajN2EhOYn+xFGqBmz3S6kUrKXKi+sSZMePyfpeEDe5qVQYmGZIx7OOuNkAGQBt tr0PQKaP2mjiXFnzf1GxP6ht2r1UWhNPIORjwV3CxrA+CFQD2UdVvL/REa9KbmBK+6fq wrdNQPNiyl7ixjEUHtuOm++ROyDYnAjscTpmpFB3x04wz1OVUi2qHBkBw8prkXFiChGU 8tJl6NjuApK5SiwcpeA441B9OvpQYou7f2+R2VFKkTYlrDCSCvbr+WnOa7YKvwBadKD6 Sjdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582752; x=1723187552; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mJAOm0hvehT/2l40ba1HUH5JT1kIkS6/KCgAYoFQhN4=; b=kx6mJkVgCuSIT4QBMpZ6PYF1r0/P0vNfT7IGA7d/LqDVkF5BaqdG0zwR6bNG9T7Jz/ FMMCJYBlPZ0A3AZaFomrwCOcXp0DdDZeLstSgMjcbo8ZptlRSLLH/tIAMOgWYgKKBJRX oNWJzixKHogmPCdIYL2Wgd8Xq/dLshmtxT3A6vzu7ump5VKnzOdBj1PwQCP9l8xRnT0Z 6R/yER5zY3GWjpK8xZRarkHgDc3+YSrZH7dcvQ+bxQ5jDbED5Q+49YS8asX5bFC0GiJh B4g7lzcC27p+eVzKDJClJAXZV0ptZPAfSaCX8VZEr8/XcKzVxw0A9xEnGoiRTAH0wBd6 hcsA== X-Gm-Message-State: AOJu0YwO9buwB2rfoQ3ABANCsXK82td5veWRdrQ3Rjtfw5sNv9cMs4Vi uKo5FBQcw0pW+mjNctXsqngXMXT46/oyyiA9yxVnberM0kpGrTUSfVsA3azZGMhrWbFv3JAqO2v ddQ== X-Google-Smtp-Source: AGHT+IEUV/wOb+LKbe/cWrfakWIoBn/TGpbw4BJ63cRHyoSW39qM6fGgTselbIwHFShgwUNia8M8IQ== X-Received: by 2002:a5d:6d49:0:b0:368:557a:c64d with SMTP id ffacd0b85a97d-36bbc0cda74mr1465810f8f.9.1722582751793; Fri, 02 Aug 2024 00:12:31 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:31 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Javier Miranda Subject: [COMMITTED 11/26] ada: Reject ambiguous function calls in interpolated string expressions Date: Fri, 2 Aug 2024 09:11:28 +0200 Message-ID: <20240802071210.413366-11-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> 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, KAM_ASCII_DIVIDERS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Javier Miranda This patch enhances support for this language feature by rejecting more ambiguous function calls. In terms of name resolution, the analysis of interpolated expressions is now treated as an expression of any type, as required by the documentation. Additionally, support for nested interpolated strings has been removed. gcc/ada/ * gen_il-fields.ads (Is_Interpolated_String_Literal): New field. * gen_il-gen-gen_nodes.adb (Is_Interpolated_String_Literal): The new field is a flag handled by the parser (syntax flag). * par-ch2.adb (P_Interpolated_String_Literal): Decorate the new flag. * sem_ch2.adb (Analyze_Interpolated_String_Literal): Improve code detecting and reporting ambiguous function calls. * sem_res.adb (Resolve_Interpolated_String_Literal): Restrict resolution imposed by the context type to string literals that have the new flag. * sinfo.ads (Is_Interpolated_String_Literal): New field defined in string literals. Fix documentation of the syntax rule of interpolated string literal. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gen_il-fields.ads | 1 + gcc/ada/gen_il-gen-gen_nodes.adb | 1 + gcc/ada/par-ch2.adb | 2 + gcc/ada/sem_ch2.adb | 242 ++++++++++++++++++++++++------- gcc/ada/sem_res.adb | 13 +- gcc/ada/sinfo.ads | 9 +- 6 files changed, 213 insertions(+), 55 deletions(-) diff --git a/gcc/ada/gen_il-fields.ads b/gcc/ada/gen_il-fields.ads index 520ea554e11..9b85401eadc 100644 --- a/gcc/ada/gen_il-fields.ads +++ b/gcc/ada/gen_il-fields.ads @@ -263,6 +263,7 @@ package Gen_IL.Fields is Is_In_Discriminant_Check, Is_Inherited_Pragma, Is_Initialization_Block, + Is_Interpolated_String_Literal, Is_Known_Guaranteed_ABE, Is_Machine_Number, Is_Null_Loop, diff --git a/gcc/ada/gen_il-gen-gen_nodes.adb b/gcc/ada/gen_il-gen-gen_nodes.adb index b1ca6cf6c86..7224556accd 100644 --- a/gcc/ada/gen_il-gen-gen_nodes.adb +++ b/gcc/ada/gen_il-gen-gen_nodes.adb @@ -444,6 +444,7 @@ begin -- Gen_IL.Gen.Gen_Nodes Cc (N_String_Literal, N_Numeric_Or_String_Literal, (Sy (Strval, String_Id), Sy (Is_Folded_In_Parser, Flag), + Sy (Is_Interpolated_String_Literal, Flag), Sm (Has_Wide_Character, Flag), Sm (Has_Wide_Wide_Character, Flag))); diff --git a/gcc/ada/par-ch2.adb b/gcc/ada/par-ch2.adb index f249ae76023..98232344dce 100644 --- a/gcc/ada/par-ch2.adb +++ b/gcc/ada/par-ch2.adb @@ -237,6 +237,7 @@ package body Ch2 is Error_Msg_SC ("string literal expected"); else + Set_Is_Interpolated_String_Literal (Token_Node); Append_To (Elements_List, Token_Node); Scan; -- past string_literal @@ -261,6 +262,7 @@ package body Ch2 is Error_Msg_SC ("unexpected string literal"); end if; + Set_Is_Interpolated_String_Literal (Token_Node); Append_To (Elements_List, Token_Node); Scan; -- past string_literal end if; diff --git a/gcc/ada/sem_ch2.adb b/gcc/ada/sem_ch2.adb index ddbb329d1f8..6d11b71b95f 100644 --- a/gcc/ada/sem_ch2.adb +++ b/gcc/ada/sem_ch2.adb @@ -138,67 +138,113 @@ package body Sem_Ch2 is procedure Analyze_Interpolated_String_Literal (N : Node_Id) is - procedure Check_Ambiguous_Parameterless_Call (Func_Call : Node_Id); - -- Examine the interpretations of the call to the given parameterless - -- function call and report the location of each interpretation. + procedure Check_Ambiguous_Call (Func_Call : Node_Id); + -- Examine the interpretations of the call to the given function call + -- and report the location of each interpretation. - ---------------------------------------- - -- Check_Ambiguous_Parameterless_Call -- - ---------------------------------------- + -------------------------- + -- Check_Ambiguous_Call -- + -------------------------- - procedure Check_Ambiguous_Parameterless_Call (Func_Call : Node_Id) is + procedure Check_Ambiguous_Call (Func_Call : Node_Id) is - procedure Report_Interpretation (E : Entity_Id); - -- Report an interpretation of the function call + procedure Report_Interpretation (Nam : Entity_Id; Typ : Entity_Id); + -- Report an interpretation of the function call. When calling a + -- standard operator, use the location of the type, which may be + -- user-defined. --------------------------- -- Report_Interpretation -- --------------------------- - procedure Report_Interpretation (E : Entity_Id) is + procedure Report_Interpretation (Nam : Entity_Id; Typ : Entity_Id) is begin - Error_Msg_Sloc := Sloc (E); + if Sloc (Nam) = Standard_Location then + Error_Msg_Sloc := Sloc (Typ); + else + Error_Msg_Sloc := Sloc (Nam); + end if; - if Nkind (Parent (E)) = N_Full_Type_Declaration then - Error_Msg_N ("interpretation (inherited) #!", Func_Call); + if Nkind (Parent (Nam)) = N_Full_Type_Declaration then + Error_Msg_N + ("\\possible interpretation (inherited)#!", Func_Call); else - Error_Msg_N ("interpretation #!", Func_Call); + Error_Msg_N ("\\possible interpretation#!", Func_Call); end if; end Report_Interpretation; - -- Local variables - - Error_Reported : Boolean; - I : Interp_Index; - It : Interp; - - -- Start of processing for Check_Ambiguous_Parameterless_Call + -- Start of processing for Check_Ambiguous_Call begin - Error_Reported := False; - - -- Examine possible interpretations - - Get_First_Interp (Name (Func_Call), I, It); - while Present (It.Nam) loop - if It.Nam /= Entity (Name (Func_Call)) - and then Ekind (It.Nam) = E_Function - and then No (First_Formal (It.Nam)) - then - if not Error_Reported then - Error_Msg_NE - ("ambiguous call to&", Func_Call, - Entity (Name (Func_Call))); - Report_Interpretation (Entity (Name (Func_Call))); - Error_Reported := True; + Check_Parameterless_Call (Func_Call); + + if Is_Overloaded (Func_Call) then + declare + I : Interp_Index; + I1 : Interp_Index; + It : Interp; + It1 : Interp; + N1 : Entity_Id; + T1 : Entity_Id; + + begin + -- Remove procedure calls, as they cannot syntactically appear + -- in interpolated expressions. These calls were not removed by + -- type checking because interpolated expressions do not impose + -- a context type. + + Get_First_Interp (Func_Call, I, It); + while Present (It.Nam) loop + if It.Typ = Standard_Void_Type then + Remove_Interp (I); + end if; + + Get_Next_Interp (I, It); + end loop; + + Get_First_Interp (Func_Call, I, It); + + if No (It.Nam) then + Error_Msg_N ("illegal expression", Func_Call); + return; end if; - Report_Interpretation (It.Nam); - end if; + I1 := I; + It1 := It; + + -- The node may be labeled overloaded, but still contain only + -- one interpretation because others were discarded earlier. If + -- this is the case, retain the single interpretation. + + Get_Next_Interp (I, It); + + if Present (It.Typ) then + N1 := It1.Nam; + T1 := It1.Typ; - Get_Next_Interp (I, It); - end loop; - end Check_Ambiguous_Parameterless_Call; + It1 := Disambiguate + (N => Func_Call, + I1 => I1, + I2 => I, + Typ => Any_Type); + + if It1 = No_Interp then + Error_Msg_NE ("ambiguous call to&", Func_Call, + Entity (Name (Func_Call))); + + -- Report the first two interpretations + + Report_Interpretation (It.Nam, It.Typ); + Report_Interpretation (N1, T1); + + return; + end if; + end if; + + Set_Etype (Func_Call, It1.Typ); + end; + end if; + end Check_Ambiguous_Call; -- Local variables @@ -211,22 +257,114 @@ package body Sem_Ch2 is Str_Elem := First (Expressions (N)); while Present (Str_Elem) loop + Analyze (Str_Elem); - -- Before analyzed, a function call that has parameter is an - -- N_Indexed_Component node, and a call to a function that has - -- no parameters is an N_Identifier node. + -- The parser has split the contents of the interpolated string + -- into its components. For example, f"before {expr} after" is + -- stored in the list of expressions of N as follows: + -- first = "before " (is_interpolated_string_literal) + -- next = expr + -- next = " after" (is_interpolated_string_literal) + -- + -- No further action is needed for string literals with the + -- attribute Is_Interpolated_String_Literal set, as they are + -- components of the interpolated string literal. The type of + -- these components will be determined by the context when + -- resolved (see Expand_N_Interpolated_String_Literal). The + -- rest of the components in the list of expressions of N are + -- the root nodes of the interpolated expressions. + + if Nkind (Str_Elem) = N_String_Literal + and then Is_Interpolated_String_Literal (Str_Elem) + then + null; - Analyze (Str_Elem); + elsif Nkind (Str_Elem) = N_Function_Call then + Check_Ambiguous_Call (Str_Elem); - -- After analyzed, if it is still an N_Identifier node then we - -- found ambiguity and could not rewrite it as N_Function_Call. + -- Before analyzed, a function call that has parameters is an + -- N_Indexed_Component node, and a call to a function that has + -- no parameters is an N_Identifier or an N_Expanded_Name node. + -- If the analysis could not rewrite it as N_Function_Call, it + -- indicates that ambiguity may have been encountered. - if Nkind (Str_Elem) = N_Identifier + elsif Nkind (Str_Elem) in N_Identifier | N_Expanded_Name and then Ekind (Entity (Str_Elem)) = E_Function - and then Is_Overloaded (Str_Elem) then - Check_Parameterless_Call (Str_Elem); - Check_Ambiguous_Parameterless_Call (Str_Elem); + Check_Ambiguous_Call (Str_Elem); + + -- Report common errors + + elsif Nkind (Str_Elem) = N_String_Literal then + + -- No further action needed for components of the interpolated + -- string literal; its type will be imposed by its context when + -- resolved. + + if Is_Interpolated_String_Literal (Str_Elem) then + null; + + else + Error_Msg_N + ("ambiguous string literal in interpolated expression", + Str_Elem); + Error_Msg_N + ("\\possible interpretation 'Ada.'String type!", + Str_Elem); + Error_Msg_N + ("\\possible interpretation 'Ada.'Wide_'String type!", + Str_Elem); + Error_Msg_N + ("\\possible interpretation 'Ada.'Wide_'Wide_'String" + & " type!", Str_Elem); + Error_Msg_N + ("\\must use a qualified expression", Str_Elem); + end if; + + elsif Nkind (Str_Elem) = N_Character_Literal then + Error_Msg_N + ("ambiguous character literal in interpolated expression", + Str_Elem); + Error_Msg_N + ("\\possible interpretation 'Ada.'Character type!", + Str_Elem); + Error_Msg_N + ("\\possible interpretation 'Ada.'Wide_'Character type!", + Str_Elem); + Error_Msg_N + ("\\possible interpretation 'Ada.'Wide_'Wide_'Character" + & " type!", Str_Elem); + Error_Msg_N + ("\\must use a qualified expression", Str_Elem); + + elsif Nkind (Str_Elem) in N_Integer_Literal + | N_Real_Literal + then + Error_Msg_N + ("ambiguous number in interpolated expression", + Str_Elem); + Error_Msg_N + ("\\must use a qualified expression", Str_Elem); + + elsif Nkind (Str_Elem) = N_Interpolated_String_Literal then + Error_Msg_N ("nested interpolated string not allowed", Str_Elem); + + elsif Etype (Str_Elem) in Any_Type + | Any_Array + | Any_Composite + | Any_Discrete + | Any_Fixed + | Any_Integer + | Any_Modular + | Any_Numeric + | Any_Real + | Any_String + | Universal_Integer + | Universal_Real + | Universal_Fixed + | Universal_Access + then + Error_Msg_N ("ambiguous interpolated expression", Str_Elem); end if; Next (Str_Elem); diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 9a3b6ddbb53..b23ca48f049 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -9702,8 +9702,19 @@ package body Sem_Res is -- image function because under Ada 2022 all the types have such -- function available. - if Etype (Str_Elem) = Any_String then + if Nkind (Str_Elem) = N_String_Literal + and then Is_Interpolated_String_Literal (Str_Elem) + then Resolve (Str_Elem, Typ); + + -- Must have been rejected during analysis + + elsif Nkind (Str_Elem) in N_Character_Literal + | N_Integer_Literal + | N_Real_Literal + | N_String_Literal + then + pragma Assert (Error_Posted (Str_Elem)); end if; Next (Str_Elem); diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 95fceb5b71b..742527fcedb 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -1749,6 +1749,11 @@ package Sinfo is -- flag aids the ABE Processing phase to suppress the diagnostics of -- finalization actions in initialization contexts. + -- Is_Interpolated_String_Literal + -- Defined in string literals. Used to differentiate string literals + -- composed of interpolated string elements from string literals found + -- in interpolated expressions. + -- Is_Known_Guaranteed_ABE -- NOTE: this flag is shared between the legacy ABE mechanism and the -- default ABE mechanism. @@ -2610,6 +2615,7 @@ package Sinfo is -- Has_Wide_Character -- Has_Wide_Wide_Character -- Is_Folded_In_Parser + -- Is_Interpolated_String_Literal -- plus fields for expression --------------------------------------- @@ -2617,8 +2623,7 @@ package Sinfo is --------------------------------------- -- INTERPOLATED_STRING_LITERAL ::= - -- '{' "{INTERPOLATED_STRING_ELEMENT}" { - -- "{INTERPOLATED_STRING_ELEMENT}" } '}' + -- 'f' "{INTERPOLATED_STRING_ELEMENT}" -- INTERPOLATED_STRING_ELEMENT ::= -- ESCAPED_CHARACTER | INTERPOLATED_EXPRESSION From patchwork Fri Aug 2 07:11:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 95163 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 835EA385E457 for ; Fri, 2 Aug 2024 07:15:19 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 15E783858289 for ; Fri, 2 Aug 2024 07:12:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 15E783858289 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 15E783858289 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582756; cv=none; b=Gt8hfHmqx5bXyZP68wnFOw/uHBXcWriUWgLgDY+cUWXCBhrvhwNyv1fNcV95QcnOK70o2izdahrrJ2N6fi5R3HadR3m47Q5muO7jYr3kOGrxLjr08fsgeoh2wZGB++tmKRTSv10tS97LhOqaeb8ZT/V7qcTfL2fD7jNmOw9JdV4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582756; c=relaxed/simple; bh=3JLzemc5UpaO+ytfjN6pWoKntG61IsoI7pEs90GLlFA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZWnzeQRx3FhOebNIAHYIXseMFlTwsmbJaKG/BPmbYiEyIg0Wonm96ZhEAIhjOynEh/BnpgF61kU12zLxIq+rzLuY1OTvhRu+ORdMLYDNwz58TdPbyT9zZTy5WKTR6s/TE85KDIubFFF88fJ1GtLSfziCbGBUcKLt3TKlnQb4r5I= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-428163f7635so50919125e9.2 for ; Fri, 02 Aug 2024 00:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582753; x=1723187553; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wC9ngaYuKMfA0zrRvwa8hompqPYenGh5Uqd79MIw9pk=; b=SHlkgO4deyLIsJ2rl1jYas6hNLl9d/DAcJMGV0/uJXwWFmOGkPilug1ncmTmaLq+Lv zIx8HWFX2+16T2j+lnGBW6bswaYjIkQEQ3cDZo64NXryRTF/uy4ThGK+NvucxeNHRwNX 2CjTIpb2aYrNDUzvNGCp4C/txE0YdVsUWn/l2YgvslCFQ+Z8PyVsZuHGd+7YvvLNuzrh YvEMDglyKaV0WukAwlO5cB5hhgSXO2pBcUfHkVgRPguxsJFmBRdkObZpClUAp6LQu6eQ c5oGq0Z9Lsoq3f1AYaHj1reCpgm6FJzchI63M3DLAskOqDuqqdFwRdMrujIGia9IHYnP t1ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582753; x=1723187553; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wC9ngaYuKMfA0zrRvwa8hompqPYenGh5Uqd79MIw9pk=; b=v75AtXSPji9/mFDxfx3nRL3nIso79TDHZ9+Km0iDU4ZSqxX1mjQJ7fZ07RldY3hBqa z30tyq5js8+i3Wd/80gbRLDp12yi24c++oRP9hQO0TdcN6SVFkfiydITmFF0RqqwpLrw R5hpNaqan0tX7mSZI0B3tgFI23H3zY6DKkRGAdK0ptPX5yEQ89hJPBE+lJvSQXjUpfko 798JO42s3SsQxab3NHp5Hj/a6LCgR3h6okCjf9k69A4pdyRL6btqJT8uUPX9vav15yF0 K+B8Jy00JjhBbz56bMz7b6VcQjOauzjrFjDs1n1WefYQBhyb/Tl3SK7TYHGPdmkToV66 pQsQ== X-Gm-Message-State: AOJu0Yw6/Pplg/koIOlmRcUOGgN3lSCDX6AfR/Vy/e0Sd5eB/Cy/mXz0 yCY2fefqDcUmb4kcdj5af1TSaPFMmdxs12RGxEx3wEdn5mgTDFx3cqoW/1wKkADUxHPOE0IHL/P Dzg== X-Google-Smtp-Source: AGHT+IEPXhIgOgltapwHJXbc2/aKIh5IPflW2p0InBCw/jI09fHOA+6Tvw3NgRMa529diYtWvkPDYg== X-Received: by 2002:a05:600c:444f:b0:426:5b3a:96c with SMTP id 5b1f17b1804b1-428e6b78e3amr15747255e9.28.1722582752627; Fri, 02 Aug 2024 00:12:32 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:32 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Tonu Naks Subject: [COMMITTED 12/26] ada: Update doc of Style_Checks pragma Date: Fri, 2 Aug 2024 09:11:29 +0200 Message-ID: <20240802071210.413366-12-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SCC_5_SHORT_WORD_LINES, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Tonu Naks gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Add examples. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../implementation_defined_pragmas.rst | 79 +++++++++++++++++-- gcc/ada/gnat_rm.texi | 77 +++++++++++++++++- gcc/ada/gnat_ugn.texi | 2 +- 3 files changed, 150 insertions(+), 8 deletions(-) diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst index 926c5f4e37b..7ff94c4c2b9 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst @@ -6328,21 +6328,91 @@ activated. These are additive, so they apply in addition to any previously set style check options. The codes for the options are the same as those used in the *-gnaty* switch to *gcc* or *gnatmake*. For example the following two methods can be used to enable -layout checking: +layout checking and to change the maximum nesting level value: * - :: + .. code-block:: ada + -- switch on layout checks pragma Style_Checks ("l"); - + -- set the number of maximum allowed nesting levels to 15 + pragma Style_Checks ("L15"); * :: - gcc -c -gnatyl ... + gcc -c -gnatyl -gnatyL15 ... + + +The string literal values can be cumulatively switched on and off by prefixing +the value with ``+`` or ``-``, where: + +* ``+`` is equivalent to no prefix. It applies the check referenced by the + literal value; +* ``-`` switches the referenced check off. + + +.. code-block:: ada + :linenos: + :emphasize-lines: 15 + + -- allow misaligned block by disabling layout check + pragma Style_Checks ("-l"); + declare + msg : constant String := "Hello"; + begin + Put_Line (msg); + end; + + -- enable the layout check again + pragma Style_Checks ("l"); + declare + msg : constant String := "Hello"; + begin + Put_Line (msg); + end; + +The code above contains two layout errors, however, only +the last line is picked up by the compiler. + +Similarly, the switches containing a numeric value can be applied in sequence. +In the example below, the permitted nesting level is reduced in in the middle +block and the compiler raises a warning on the highlighted line. +.. code-block:: ada + :linenos: + :emphasize-lines: 15 + + -- Permit 3 levels of nesting + pragma Style_Checks ("L3"); + + procedure Main is + begin + if True then + if True then + null; + end if; + end if; + -- Reduce permitted nesting levels to 2. + -- Note that "+L2" and "L2" are equivalent. + pragma Style_Checks ("+L2"); + if True then + if True then + null; + end if; + end if; + -- Disable checking permitted nesting levels. + -- Note that the number after "-L" is insignificant, + -- "-L", "-L3" and "-Lx" are all equivalent. + pragma Style_Checks ("-L3"); + if True then + if True then + null; + end if; + end if; + end Main; The form ``ALL_CHECKS`` activates all standard checks (its use is equivalent to the use of the :switch:`gnaty` switch with no options. @@ -6356,7 +6426,6 @@ The forms with ``Off`` and ``On`` can be used to temporarily disable style checks as shown in the following example: - .. code-block:: ada pragma Style_Checks ("k"); -- requires keywords in lower case diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index d5e8931e088..3a766ccc38d 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -7901,22 +7901,95 @@ activated. These are additive, so they apply in addition to any previously set style check options. The codes for the options are the same as those used in the `-gnaty' switch to `gcc' or `gnatmake'. For example the following two methods can be used to enable -layout checking: +layout checking and to change the maximum nesting level value: @itemize * @item @example +-- switch on layout checks pragma Style_Checks ("l"); +-- set the number of maximum allowed nesting levels to 15 +pragma Style_Checks ("L15"); @end example @item @example -gcc -c -gnatyl ... +gcc -c -gnatyl -gnatyL15 ... @end example @end itemize +The string literal values can be cumulatively switched on and off by prefixing +the value with @code{+} or @code{-}, where: + + +@itemize * + +@item +@code{+} is equivalent to no prefix. It applies the check referenced by the +literal value; + +@item +@code{-} switches the referenced check off. +@end itemize + +@example +-- allow misaligned block by disabling layout check +pragma Style_Checks ("-l"); +declare + msg : constant String := "Hello"; +begin + Put_Line (msg); + end; + +-- enable the layout check again +pragma Style_Checks ("l"); +declare + msg : constant String := "Hello"; +begin + Put_Line (msg); + end; +@end example + +The code above contains two layout errors, however, only +the last line is picked up by the compiler. + +Similarly, the switches containing a numeric value can be applied in sequence. +In the example below, the permitted nesting level is reduced in in the middle +block and the compiler raises a warning on the highlighted line. + +@example +-- Permit 3 levels of nesting +pragma Style_Checks ("L3"); + +procedure Main is +begin + if True then + if True then + null; + end if; + end if; + -- Reduce permitted nesting levels to 2. + -- Note that "+L2" and "L2" are equivalent. + pragma Style_Checks ("+L2"); + if True then + if True then + null; + end if; + end if; + -- Disable checking permitted nesting levels. + -- Note that the number after "-L" is insignificant, + -- "-L", "-L3" and "-Lx" are all equivalent. + pragma Style_Checks ("-L3"); + if True then + if True then + null; + end if; + end if; +end Main; +@end example + The form @code{ALL_CHECKS} activates all standard checks (its use is equivalent to the use of the @code{gnaty} switch with no options. See the @cite{GNAT User’s Guide} for details.) diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index ea1d2f9d71a..0e3ee935552 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -29670,8 +29670,8 @@ to permit their use in free software. @printindex ge -@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @anchor{d1}@w{ } +@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @c %**end of body @bye From patchwork Fri Aug 2 07:11:30 2024 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: 95168 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 20257385E836 for ; Fri, 2 Aug 2024 07:16:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by sourceware.org (Postfix) with ESMTPS id 50AE0385E45B for ; Fri, 2 Aug 2024 07:12:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 50AE0385E45B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 50AE0385E45B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::230 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582761; cv=none; b=ZVR69nzAN82aISsWmXY2XJ5xeYRRZ9P9vungaISAGa2xIMl4nIr1VhdlmMWHmqkmvOBMg4YuO4iROPC2WHGWQVKsKsh9lofDOFvdoKUzeIpxSWIR5N9RUqzLfKmB0h/1AjYxJmdxiw9xFKO6Gy1yPHKTJ25J6LYTclBBUXq9gv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582761; c=relaxed/simple; bh=fsEbIFNTEpw2eVGi1co3AZ3JMegAqg9N5Iioaru9cr4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=VoomP0g8H/O7H5GpHH8+OVISnvOoE6vLaV5ku3PKNxtZ6v0vBxchmwbORFN27yJrU6BoXwbvqVmEaf0b2Tx9gvDeLrtP1cFApc/j4xp8vLUztzJ29eDcfj4mwthJ6Ebdr31aWhnabOKmH8H1WOA1CWYzz7pEv85wRZFyESJMDZA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2f15790b472so18686001fa.0 for ; Fri, 02 Aug 2024 00:12:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582754; x=1723187554; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7ojj1wv8YHL4lwXSvP5UPnYyWtcnVsIyEldZpET0R8o=; b=iHZJcFw/wp4eANbMQCx/LvUP8Dd5rBvrMEWnWpSGpb32gb/yTcpJ+nLDP305im8W5F h2YVErThoojDqSBSVbdvaA/w9tAm7kqMvI28nsbatjHXxMUQJN3IflTX7Ku/DHAa9wMP XqnvNnSzeXJFVbg/dP9QOc+LntQnxqas5x6sWrBqpmTmlr2akdgXGbeRmyvrjCUNLg3C s6nbxDIyjD0He4jQE3LmZFJDcMowCvYGVs1k4KAc/60cYf3orNA+JRXTQPph33Z6yjbF PtHo35Swpcs3mbrvZWLsHFlA6c4YVuZ6EkCpVGiC8qs5Qh0YOc2duBzPdy9K0tkupCP6 SNbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582754; x=1723187554; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7ojj1wv8YHL4lwXSvP5UPnYyWtcnVsIyEldZpET0R8o=; b=IJzWUwEOj3mLs0nYlYsifqge0t9oO5OT3jdJQaMwpdX9kr3BLryRQUB2o/nXCGSc0b Uazvs7uBbsrfGUc7ZzIfWAQ/pQrJy1Rj5FP2HSzCMAr8+3JgmtMGkHXQn1Xeq6xiGwEh QdXulBYVj3d7DaPmpg3tDYMqCtuIQwC8uvTYg5qnsTpUm1A1rEGn5iaGiBrmeQzl6viz Fz0Iqo/Dcz8bblxNRQnq0lAjEhfilCjm3O1laNPQItePMwKrGig3SY1hhW4LlW/m7LWt pAX+pNHmqPfT/hg6rQxVdl3KbNk1owzqlVEkCspQiQWEW3A97Tahc9jd3MCcmA8mJ89q ndsg== X-Gm-Message-State: AOJu0YzHKz1tZqNhzdvTheZEFmfcsmIZnGXmIRQeXAUZ04KzYYx5+kay Il88ZSO/EdRyJ12eOWrryuBYn6563WDMgFwO0tTJ8cUYG95fr7TykdF3X7IlLwol9etYO0/zW2P PJg== X-Google-Smtp-Source: AGHT+IF/4WDxsBBsRQzM7gAVYQuD4mGAwHIsS1ebiTe/wZ8ViD2W28lzDynIzU7MzRqj9LxsC1/D+g== X-Received: by 2002:a2e:979a:0:b0:2ef:2b53:c785 with SMTP id 38308e7fff4ca-2f15ab35233mr16995651fa.41.1722582753440; Fri, 02 Aug 2024 00:12:33 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:33 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Tonu Naks Subject: [COMMITTED 13/26] ada: Add leap second support to conversion of Unix_Time Date: Fri, 2 Aug 2024 09:11:30 +0200 Message-ID: <20240802071210.413366-13-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Tonu Naks Unix timestamp jumps one second back when a leap second is applied and doesn't count cumulative leap seconds. This was not taken into account in conversions between Unix time and Ada time. Now fixed. gcc/ada/ * libgnat/a-calend.adb: Modify unix time handling. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/a-calend.adb | 135 ++++++++++++++++++----------------- 1 file changed, 70 insertions(+), 65 deletions(-) diff --git a/gcc/ada/libgnat/a-calend.adb b/gcc/ada/libgnat/a-calend.adb index 1083ece44d2..c28042d13c4 100644 --- a/gcc/ada/libgnat/a-calend.adb +++ b/gcc/ada/libgnat/a-calend.adb @@ -110,6 +110,17 @@ is new Ada.Unchecked_Conversion (Duration, Time_Rep); -- Convert a duration value into a time representation value + function Elapsed_Leaps (Start_Time, End_Time : Time_Rep) return Natural + with Pre => (End_Time >= Start_Time); + -- If the target supports leap seconds, determine the number of leap + -- seconds elapsed between start_time and end_time. + -- + -- NB! This function assumes that End_Time is not smaller than + -- Start_Time. There are usages of the function that correct the time + -- by passed leap seconds and use the results for another seach. + -- If negative leap seconds are introduced eventually, then such + -- calls should be revised as the correction can go to either direction. + function Time_Rep_To_Duration is new Ada.Unchecked_Conversion (Time_Rep, Duration); -- Convert a time representation value into a duration value @@ -355,13 +366,34 @@ is end if; end Check_Within_Time_Bounds; + ------------------- + -- Elapsed_Leaps -- + ------------------- + + function Elapsed_Leaps (Start_Time, End_Time : Time_Rep) return Natural + is + Elapsed : Natural := 0; + Next_Leap_N : Time_Rep; + begin + if Leap_Support then + Cumulative_Leap_Seconds + (Start_Time, End_Time, Elapsed, Next_Leap_N); + + -- The system clock may fall exactly on a leap second + + if End_Time >= Next_Leap_N then + Elapsed := Elapsed + 1; + end if; + end if; + + return Elapsed; + end Elapsed_Leaps; + ----------- -- Clock -- ----------- function Clock return Time is - Elapsed_Leaps : Natural; - Next_Leap_N : Time_Rep; -- The system clock returns the time in UTC since the Unix Epoch of -- 1970-01-01 00:00:00.0. We perform an origin shift to the Ada Epoch @@ -371,26 +403,7 @@ is Duration_To_Time_Rep (System.OS_Primitives.Clock) + Unix_Min; begin - -- If the target supports leap seconds, determine the number of leap - -- seconds elapsed until this moment. - - if Leap_Support then - Cumulative_Leap_Seconds - (Start_Of_Time, Res_N, Elapsed_Leaps, Next_Leap_N); - - -- The system clock may fall exactly on a leap second - - if Res_N >= Next_Leap_N then - Elapsed_Leaps := Elapsed_Leaps + 1; - end if; - - -- The target does not support leap seconds - - else - Elapsed_Leaps := 0; - end if; - - Res_N := Res_N + Time_Rep (Elapsed_Leaps) * Nano; + Res_N := Res_N + Time_Rep (Elapsed_Leaps (Start_Of_Time, Res_N)) * Nano; return Time (Res_N); end Clock; @@ -806,10 +819,8 @@ is is Res_Dur : Time_Dur; Earlier : Time_Rep; - Elapsed_Leaps : Natural; Later : Time_Rep; Negate : Boolean := False; - Next_Leap_N : Time_Rep; Sub_Secs : Duration; Sub_Secs_Diff : Time_Rep; @@ -825,22 +836,6 @@ is Negate := True; end if; - -- If the target supports leap seconds, process them - - if Leap_Support then - Cumulative_Leap_Seconds - (Earlier, Later, Elapsed_Leaps, Next_Leap_N); - - if Later >= Next_Leap_N then - Elapsed_Leaps := Elapsed_Leaps + 1; - end if; - - -- The target does not support leap seconds - - else - Elapsed_Leaps := 0; - end if; - -- Sub seconds processing. We add the resulting difference to one -- of the input dates in order to account for any potential rounding -- of the difference in the next step. @@ -856,12 +851,14 @@ is -- either add or drop a second. We compensate for this issue in the -- previous step. + Leap_Seconds := Elapsed_Leaps (Earlier, Later); + Res_Dur := - Time_Dur (Later / Nano - Earlier / Nano) - Time_Dur (Elapsed_Leaps); + Time_Dur (Later / Nano - Earlier / Nano) - + Time_Dur (Leap_Seconds); Days := Long_Integer (Res_Dur / Secs_In_Day); Seconds := Duration (Res_Dur mod Secs_In_Day) + Sub_Secs; - Leap_Seconds := Integer (Elapsed_Leaps); if Negate then Days := -Days; @@ -901,9 +898,33 @@ is function To_Ada_Time (Unix_Time : Long_Integer) return Time is pragma Unsuppress (Overflow_Check); - Unix_Rep : constant Time_Rep := Time_Rep (Unix_Time) * Nano; + Ada_Rep : Time_Rep := Time_Rep (Unix_Time * Nano) - Epoch_Offset; + + -- Count leaps passed until the converted time. + + Leaps : constant Natural := + Elapsed_Leaps (Start_Of_Time, Ada_Rep); begin - return Time (Unix_Rep - Epoch_Offset); + + -- If leap seconds were found then update the result accordingly + + if Leaps /= 0 then + declare + -- adjust the time by the number of leap seconds + Corrected_Ada_Rep : constant Time_Rep := + Ada_Rep + Time_Rep ((Leaps) * Nano); + + -- Check if the corrected time passed the boundary + -- of another leap second + Extra_Leaps : constant Natural := + Elapsed_Leaps (Ada_Rep, Corrected_Ada_Rep); + begin + Ada_Rep := Corrected_Ada_Rep + Time_Rep (Extra_Leaps * Nano); + end; + end if; + + return Time (Ada_Rep); + exception when Constraint_Error => raise Time_Error; @@ -1085,7 +1106,8 @@ is pragma Unsuppress (Overflow_Check); Ada_Rep : constant Time_Rep := Time_Rep (Ada_Time); begin - return Long_Integer ((Ada_Rep + Epoch_Offset) / Nano); + return Long_Integer ((Ada_Rep + Epoch_Offset) / Nano) - + Long_Integer (Elapsed_Leaps (Start_Of_Time, Ada_Rep)); exception when Constraint_Error => raise Time_Error; @@ -1112,9 +1134,7 @@ is -- failure. To prevent this, the function returns the "safe" end of -- time (roughly 2219) which is still distant enough. - Elapsed_Leaps : Natural; - Next_Leap_N : Time_Rep; - Res_N : Time_Rep; + Res_N : Time_Rep; begin Res_N := Time_Rep (Date); @@ -1122,23 +1142,8 @@ is -- Step 1: If the target supports leap seconds, remove any leap -- seconds elapsed up to the input date. - if Leap_Support then - Cumulative_Leap_Seconds - (Start_Of_Time, Res_N, Elapsed_Leaps, Next_Leap_N); - - -- The input time value may fall on a leap second occurrence - - if Res_N >= Next_Leap_N then - Elapsed_Leaps := Elapsed_Leaps + 1; - end if; - - -- The target does not support leap seconds - - else - Elapsed_Leaps := 0; - end if; - - Res_N := Res_N - Time_Rep (Elapsed_Leaps) * Nano; + Res_N := Res_N - + Time_Rep (Elapsed_Leaps (Start_Of_Time, Res_N)) * Nano; -- Step 2: Perform a shift in origins to obtain a Unix equivalent of -- the input. Guard against very large delay values such as the end From patchwork Fri Aug 2 07:11:31 2024 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: 95160 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 F11D6385DDC4 for ; Fri, 2 Aug 2024 07:14:22 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id AD06A385DDF0 for ; Fri, 2 Aug 2024 07:12:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AD06A385DDF0 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AD06A385DDF0 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582761; cv=none; b=XvO240Ftvhu/7IR/k5yfw7h2JVcaSvemZvrmEPkIird4EMkXRXJcFb/M0W8x5mLLGL/MA1jRIhxZuLI8mmOOgKjCy+HP+3UlcadEIJn8NU+lVrmK9pw6adgLGKU/2LWYLCJSXXO871p2zIhLvefDMqC4Bri1mzFbD9S3MNHBcrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582761; c=relaxed/simple; bh=czfvnM98rpcw/3nrv3q6KhNperIrhpLNdyiyHCTHa/I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=pt7KqTl83Nq6tgzs9ZdgJadme8JiK2VEA00twqNEQwo4+5bwl5qv2rVwTSeTpcEJbSY5N0YMHlxm7LK5CrvzrCdKq9rLnnWIYICUbawt35dqwVCB8KbRYBnTor2kakC9HH+21gwvYYIIcJvJv7cmuvYCh3nWr+Qld8q0wlByY/c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3683f56b9bdso3938302f8f.1 for ; Fri, 02 Aug 2024 00:12:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582754; x=1723187554; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uncvAbgNDGIR6VggfJICROjzIf77KSpXMfIndcOe3YY=; b=D3s3HgNge6Db7RzIvvcBKRVhsFQIyT9af//YLlci67SJ5xmDLtmGSCR6NXxT/AdwCD F3vteAZNnj33IR7HBFuqPAq/Rb101a44ymsue6oDwPBJnDdIAAVh+p0Ux+j+jAU4SWJi HD/bLdklJIFdvp/B5lSQVRMa0RfvOxcRkIbM7iV/3a9/7/YcNcdY4N/07RmK1t+QWvKx vjuA5AOKFJpJPK1Uk3/SkWGRjjFhCVe9r8CcmM3TiNPv2FPWvm/BVbQ5upQ4kUZ+L6Yh ymAn1ypeLzgN0famhh0EIOdo00uUfZHe96eSlE7tLo/7phF588F8RXAcfX0oWoD/ZS4t X0cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582754; x=1723187554; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uncvAbgNDGIR6VggfJICROjzIf77KSpXMfIndcOe3YY=; b=DC94BKzUxr/+9SFotkWsu25qm3YMiwbzEYArTxBE7g+weUQeRUIL3iZ6AQyaLQV8JQ VjiQvPG8mNA1uKY3inyZ8KGijHo+8QaAnZ/qewEp77fNS9JuNjQ8mN7fr7s09a4CeD8k K/iwNyAl140VJ9Xmuea0tJWhtDhrZNbfwJX5C3D5utegTu+djngCQMb4ZCpwyrwpd9fX 60UiP3ZY3WzfBZNfCrFlHsJD0IZrzVM4q/k2rYVywKMxMznPxK794jKnq4i8GbHU/YpK gWR4MSL/asfWdrxIDHxj35/f5+z8BgDWasot8L7KuvxeQGpAdlgnTf9QQrtTahko3Wur Sxcg== X-Gm-Message-State: AOJu0Yx53pJp8njcqypAMa+s49klQlqcCGdO9BDMORZds8LTnpFXKw0O 5Od43pbmJUMHUXn/AwcxB+ziL61fF1lgqg+E3nMtFXd8/K/vqHYtQUc6JP9FS9P4QNz4uTkcgzz txQ== X-Google-Smtp-Source: AGHT+IEgY1aiN+AeyOES9tgwpkefmnQI4+tX2Q7Iy65lFkuEqkQNJsRCKOiNgz5I1cmZlJB4rEqF3g== X-Received: by 2002:adf:e903:0:b0:367:9279:c401 with SMTP id ffacd0b85a97d-36bbc10f03cmr1631135f8f.34.1722582754308; Fri, 02 Aug 2024 00:12:34 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:33 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Richard Kenner Subject: [COMMITTED 14/26] ada: Clean up handling of inlining of finalizer procedures Date: Fri, 2 Aug 2024 09:11:31 +0200 Message-ID: <20240802071210.413366-14-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Richard Kenner Change Is_Finalizer from synthesized attribute into flag. Remove duplicate Is_Finalizer_Proc. Add new Try_Inline_Always for backend usage. gcc/ada/ * einfo-utils.ads (Is_Finalizer): Delete. * einfo-utils.adb (Is_Finalizer): Delete. * einfo.ads: Adjust comment. * gen_il-fields.ads, gen_il-gen-gen_entities.adb: Add Is_Finalizer flag. * exp_ch3.adb (Build_Init_Procedure): Set it. * exp_ch7.adb (Create_Finalizer): Likewise. * exp_util.adb (Try_Inline_Always): New function. * exp_util.ads (Try_Inline_Always): New function. * sem_elab.adb (Is_Finalizer_Proc): Replace with Is_Finalizer. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/einfo-utils.adb | 9 --------- gcc/ada/einfo-utils.ads | 1 - gcc/ada/einfo.ads | 2 +- gcc/ada/exp_ch3.adb | 1 + gcc/ada/exp_ch7.adb | 1 + gcc/ada/exp_util.adb | 10 ++++++++++ gcc/ada/exp_util.ads | 5 +++++ gcc/ada/gen_il-fields.ads | 1 + gcc/ada/gen_il-gen-gen_entities.adb | 1 + gcc/ada/sem_elab.adb | 26 +++++--------------------- 10 files changed, 25 insertions(+), 32 deletions(-) diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb index c0c79f92e13..3dc25b36ad4 100644 --- a/gcc/ada/einfo-utils.adb +++ b/gcc/ada/einfo-utils.adb @@ -1567,15 +1567,6 @@ package body Einfo.Utils is Has_Option (Id, Name_Synchronous)); end Is_External_State; - ------------------ - -- Is_Finalizer -- - ------------------ - - function Is_Finalizer (Id : E) return B is - begin - return Ekind (Id) = E_Procedure and then Chars (Id) = Name_uFinalizer; - end Is_Finalizer; - ---------------------- -- Is_Full_Access -- ---------------------- diff --git a/gcc/ada/einfo-utils.ads b/gcc/ada/einfo-utils.ads index 8207576fb89..c0480c71cb8 100644 --- a/gcc/ada/einfo-utils.ads +++ b/gcc/ada/einfo-utils.ads @@ -190,7 +190,6 @@ package Einfo.Utils is function Is_Dynamic_Scope (Id : E) return B; function Is_Elaboration_Target (Id : E) return B; function Is_External_State (Id : E) return B; - function Is_Finalizer (Id : E) return B with Inline; function Is_Full_Access (Id : E) return B with Inline; function Is_Null_State (Id : E) return B; function Is_Package_Or_Generic_Package (Id : E) return B with Inline; diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 9d0f2ee3c02..4486ab3636f 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -2647,7 +2647,7 @@ package Einfo is -- the transient finalization mechanisms. The flag prevents the double -- finalization of the object. --- Is_Finalizer (synthesized) +-- Is_Finalizer -- Applies to all entities, true for procedures containing finalization -- code to process local or library level objects. diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 6fee2b41bac..bf04ea9d70a 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -3532,6 +3532,7 @@ package body Exp_Ch3 is DF_Id := Make_Defining_Identifier (Loc, Chars => New_External_Name (Name_uFinalizer)); + Set_Is_Finalizer (DF_Id); Append_To (Decls, Make_Local_Deep_Finalize (Rec_Type, DF_Id)); diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index b545a58448d..72f0b539c2e 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -1979,6 +1979,7 @@ package body Exp_Ch7 is Fin_Id := Make_Defining_Identifier (Loc, Chars => New_External_Name (Name_uFinalizer)); + Set_Is_Finalizer (Fin_Id); -- The visibility semantics of At_End handlers force a strange -- separation of spec and body for stack-related finalizers: diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index c5d3af7545e..bd8bbb39d9c 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -14525,6 +14525,16 @@ package body Exp_Util is return Target; end Thunk_Target; + ----------------------- + -- Try_Inline_Always -- + ----------------------- + + function Try_Inline_Always (Subp : Entity_Id) return Boolean is + ((Is_Expression_Function (Subp) or else Is_Finalizer (Subp)) + and then not Debug_Flag_Dot_8); + -- We want to inline expression functions and finalizers as much as + -- practical unless -gnatd.8. + ------------------- -- Type_Map_Hash -- ------------------- diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index 7fbbe5fc9fd..14d9e345b53 100644 --- a/gcc/ada/exp_util.ads +++ b/gcc/ada/exp_util.ads @@ -1260,6 +1260,11 @@ package Exp_Util is -- WARNING: There is a matching C declaration of this subprogram in fe.h + function Try_Inline_Always (Subp : Entity_Id) return Boolean; + -- Determines if the backend should try hard to inline Subp. This is + -- similar to Subp having a pragma Inline_Always, but doesn't cause an + -- error if Subp can't actually be inlined. + function Type_May_Have_Bit_Aligned_Components (Typ : Entity_Id) return Boolean; -- Determines if Typ is a composite type that has within it (looking down diff --git a/gcc/ada/gen_il-fields.ads b/gcc/ada/gen_il-fields.ads index 9b85401eadc..22fd1e372f6 100644 --- a/gcc/ada/gen_il-fields.ads +++ b/gcc/ada/gen_il-fields.ads @@ -708,6 +708,7 @@ package Gen_IL.Fields is Is_Exception_Handler, Is_Exported, Is_Finalized_Transient, + Is_Finalizer, Is_First_Subtype, Is_Fixed_Lower_Bound_Array_Subtype, Is_Fixed_Lower_Bound_Index_Subtype, diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb index 86701cf9e31..29b22c62587 100644 --- a/gcc/ada/gen_il-gen-gen_entities.adb +++ b/gcc/ada/gen_il-gen-gen_entities.adb @@ -146,6 +146,7 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Is_Entry_Formal, Flag), Sm (Is_Entry_Wrapper, Flag), Sm (Is_Exported, Flag), + Sm (Is_Finalizer, Flag), Sm (Is_First_Subtype, Flag), Sm (Is_Formal_Subprogram, Flag), Sm (Is_Frozen, Flag), diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index a030d6b06f1..0b5f87bd828 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -1778,11 +1778,6 @@ package body Sem_Elab is -- Determine whether arbitrary entity Id denotes internally generated -- routine Default_Initial_Condition. - function Is_Finalizer_Proc (Id : Entity_Id) return Boolean; - pragma Inline (Is_Finalizer_Proc); - -- Determine whether arbitrary entity Id denotes internally generated - -- routine _Finalizer. - function Is_Initial_Condition_Proc (Id : Entity_Id) return Boolean; pragma Inline (Is_Initial_Condition_Proc); -- Determine whether arbitrary entity Id denotes internally generated @@ -2438,7 +2433,7 @@ package body Sem_Elab is -- Calls to _Finalizer procedures must not appear in the output -- because this creates confusing noise. - elsif Is_Finalizer_Proc (Subp_Id) then + elsif Is_Finalizer (Subp_Id) then null; -- Initial_Condition @@ -5338,7 +5333,7 @@ package body Sem_Elab is return (Is_Controlled_Procedure (Subp_Id, Name_Finalize) - or else Is_Finalizer_Proc (Subp_Id) + or else Is_Finalizer (Subp_Id) or else Is_TSS (Subp_Id, TSS_Deep_Finalize)) and then In_Initialization_Context (Call); end Is_Partial_Finalization_Proc; @@ -6607,7 +6602,7 @@ package body Sem_Elab is -- Calls to _Finalizer procedures must not appear in the output -- because this creates confusing noise. - elsif Is_Finalizer_Proc (Subp_Id) then + elsif Is_Finalizer (Subp_Id) then null; -- Initial_Condition @@ -13098,7 +13093,7 @@ package body Sem_Elab is -- Controlled finalization actions elsif Is_Controlled_Procedure (Targ_Id, Name_Finalize) - or else Is_Finalizer_Proc (Targ_Id) + or else Is_Finalizer (Targ_Id) then Extra := First_Formal_Type (Targ_Id); Kind := Controlled_Finalization; @@ -14467,7 +14462,7 @@ package body Sem_Elab is begin return Is_Accept_Alternative_Proc (Id) - or else Is_Finalizer_Proc (Id) + or else Is_Finalizer (Id) or else Is_Partial_Invariant_Proc (Id) or else Is_TSS (Id, TSS_Deep_Adjust) or else Is_TSS (Id, TSS_Deep_Finalize) @@ -14488,17 +14483,6 @@ package body Sem_Elab is return Ekind (Id) = E_Procedure and then Is_DIC_Procedure (Id); end Is_Default_Initial_Condition_Proc; - ----------------------- - -- Is_Finalizer_Proc -- - ----------------------- - - function Is_Finalizer_Proc (Id : Entity_Id) return Boolean is - begin - -- To qualify, the entity must denote a _Finalizer procedure - - return Ekind (Id) = E_Procedure and then Chars (Id) = Name_uFinalizer; - end Is_Finalizer_Proc; - ------------------------------- -- Is_Initial_Condition_Proc -- ------------------------------- From patchwork Fri Aug 2 07:11:32 2024 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: 95176 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 8F934385DDF0 for ; Fri, 2 Aug 2024 07:19:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 5CA8F385ED4F for ; Fri, 2 Aug 2024 07:12:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5CA8F385ED4F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5CA8F385ED4F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::334 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582761; cv=none; b=kKjPK1vJYJozZHOBn9qocjaMWmeF1DV1D7WRPkijwv5h7H7bdDNseGSpvdFIpbpTeGINcW1wNjZOQG389UE1flUDJt08jWmvBgQdoM8TXUpTotaGDjtLo933S/+QR3LjSuBabJN7kfPvlCzTO9yQLxqz9ie005loEWgFUKBUOYk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582761; c=relaxed/simple; bh=7lBPPensJngVPwg7rmmVrXYjlPEmuINSwxclHyk5d6A=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ND4t5/w7lI71EvGrhgYO/K0haZSHnxwhv1v5JVS0ajUVwijgbbsQMpaOmhqw0FPAiCVIg3vM3Y8hBaxGjFWRcV/RMvjusDtDDdc/QVrZ1QGo4X8TVkBxTnXvxi1ukN6J+1iPsWzMaYSJbPUjD5y2R5eUyV2LJZQgQ+7VHFnZ/pg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-428e0d18666so11803855e9.3 for ; Fri, 02 Aug 2024 00:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582755; x=1723187555; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3Mx9UsnJ1Nax+rI42bEBMXVMPEvZU+SPF8Q9mLWHawY=; b=gMx3xiV1tMub23SgyVCVcmtpcfy1K4Pr+klmlDR3/DOXvcvVqnwulL85UEu1/hfOSl TDewskExYRVrNegZ38Tq2dPLrcXN/ZPbOXzT+3ir7aaWdp6XFjmCr35L9/0sMkOIsPHP gu71uImCi5qTygYWGFTjS5ZP1fOxcQ074YnTHaTKxv5PyMbRZ6FaS77qJcZD5dMZQ2KS iCIq39POjEmmpXC9P9Z/5WwonsXVVhnqKt7cvClNwYqFxkjqnxkP+lxZkFnS0QM0EZ4y J0PjuA+Xsrmt9R9t0PH/GKePyREZ6KdPCxpJj/WcXESnC7NHu1wA9oheYY9kgRbLxnIN a/SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582755; x=1723187555; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3Mx9UsnJ1Nax+rI42bEBMXVMPEvZU+SPF8Q9mLWHawY=; b=gdcOMdeTl1lctvoEVSPudue2OaTF/FEXYLGrJvw/aSZ/o69RIrimfZ8giBcxG9k81l giiOuX//EKb3R84J/nBwUAorK2BiIWbT6JxD3nGPnOe9+Bg5k3fNat6ARfTTAHt3HyqD nCKDvDlX/X9GSt2Bdej0jWcA40ndy15Iu+ZkRVTXWIdN97C2X0N67RdBMz/2xA9TNUxd D2jsuOlcf1Up8sdKGfg7kTa95s60oeJdtZ9cVIkvPFLTjtHXl4V3xRgHTkSjpKNZpF2d Feip4mv/wadw9wyZSb8L2CH0W1fGkl20NN1dlVu+qM/C8SvFsq7IBxdL8LriT4PssJ84 KZDQ== X-Gm-Message-State: AOJu0YywMT3LdtYDs7i+n7kjRRU3E2u7YQ5UmIINxJwmX+cfiJ2vssPC nLksgJxCAXEtfcvLiAXDRQT1uanb/cGF7mgPps8K4uEPvNlelvvuhAbeo83Ry+sk3/nJQlJCjve Wkg== X-Google-Smtp-Source: AGHT+IE2NSseRLcZDGA3J7h7JiWE1lI6OibQmBl9lpL+K0fHDYJwtIAItB6Mk5lrq0OwqjT1Hp7BUA== X-Received: by 2002:a05:600c:1c8a:b0:426:61af:e1d6 with SMTP id 5b1f17b1804b1-428e6b7be7dmr16800725e9.29.1722582755037; Fri, 02 Aug 2024 00:12:35 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:34 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Richard Kenner Subject: [COMMITTED 15/26] ada: Remove unreferenced procedure Date: Fri, 2 Aug 2024 09:11:32 +0200 Message-ID: <20240802071210.413366-15-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Richard Kenner gcc/ada/ * exp_ch4.adb (Generate_Temporary): Remove unused procedure. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch4.adb | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 371cb118243..18ec7125cc1 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -10816,49 +10816,6 @@ package body Exp_Ch4 is Expr : Node_Id; Ityp : Entity_Id; - procedure Generate_Temporary; - -- Generate a temporary to facilitate in the C backend the code - -- generation of the unchecked conversion since the size of the - -- source type may differ from the size of the target type. - - ------------------------ - -- Generate_Temporary -- - ------------------------ - - procedure Generate_Temporary is - begin - if Esize (Etype (Expr)) < Esize (Etype (Ityp)) then - declare - Exp_Type : constant Entity_Id := Ityp; - Def_Id : constant Entity_Id := - Make_Temporary (Loc, 'R', Expr); - E : Node_Id; - Res : Node_Id; - - begin - Set_Is_Internal (Def_Id); - Set_Etype (Def_Id, Exp_Type); - Res := New_Occurrence_Of (Def_Id, Loc); - - E := - Make_Object_Declaration (Loc, - Defining_Identifier => Def_Id, - Object_Definition => New_Occurrence_Of - (Exp_Type, Loc), - Constant_Present => True, - Expression => Relocate_Node (Expr)); - - Set_Assignment_OK (E); - Insert_Action (Expr, E); - - Set_Assignment_OK (Res, Assignment_OK (Expr)); - - Rewrite (Expr, Res); - Analyze_And_Resolve (Expr, Exp_Type); - end; - end if; - end Generate_Temporary; - -- Start of processing for Discrete_Range_Check begin From patchwork Fri Aug 2 07:11:33 2024 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: 95167 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 4F689385B50B for ; Fri, 2 Aug 2024 07:16:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 25C663858428 for ; Fri, 2 Aug 2024 07:12:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 25C663858428 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 25C663858428 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582761; cv=none; b=KOPoyh/FBMSEOtivoZqLBP/lDOM5+V3FuUckI7OzrrC00MLbKMwd3I9mR0i9O0A2+KUEZbdUcb7XcrMo7DI9EbGb5hnTy0yCu8OOf/diHmfTlwnTSTw6CiEsKpf++eN1VsOf2H5ynCkrWt2WemrOkBB3jdQGEszLhWKNO8stkWQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582761; c=relaxed/simple; bh=7tpKgtZT7eFJiNNJfkUaHd4/z99UWavJpKf0fmzI3Uk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Mp5ib++Ep1gnpUI/R7VO70XXcmifcPSBfQicjAKHtg5Yj9eTNSwjvjZqKieNSDHvXywRop1KAgItQSkFmd5PEWEfRYEN6lKNsPHaYTVMsIKSXmtixifpi2sYIydXwXbCirleDkDHESSP22PXuN/mhPZNdSkgLz1xaK2kvb56CuU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42816ca782dso50544725e9.2 for ; Fri, 02 Aug 2024 00:12:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582756; x=1723187556; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=myPixyBqLHqaT5yMB04M8oL7kg1FVtQTke/bpxRi7Mg=; b=C4wyZ3DWLEMH5j6prw1hYBnJNGWsmXpCgWoSyW53YFpJot4MOHb+l94ND208dhdjbn yM2ILAyngTxZQxCOg+/ZJu7vFIF/SCTrY+JNuLZFGc0t1Q6mjQGGbAngRfiK4lFsMZyv 3DptvBJ+ITMtOOT7Vu5z9KXMDwU1Ut1M2GQnHzH31pqrQxX69UL7/3E5QTLy0MmQf01G F927xLY3MmO61F5peJSCT8GUeoxrSxKNeEqzcgNhXQhRK0xNzIuL+Ly/kd/+xSggmE9n Zz7+0SIFRa+mvJ0qiZJALS7zkYzx6m2XE7CJvux0Zc2LhcBRRid+VNwbrQDqij34d8Cx t6Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582756; x=1723187556; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=myPixyBqLHqaT5yMB04M8oL7kg1FVtQTke/bpxRi7Mg=; b=B4NspjgleJoRyHY+9CaeCsrN/NOUhhw5Q3mdTE8qKvoCF5KqbRVpImUxeY6p1KCsw0 qmFIBywFyCiHHmZ1dhwJ+CNsZ4Tsq0h58toNYQ7reO3qxZEFojBBjTcBM+vgFNZmb7fg f8wA2iCiJwkgmEh2MvPkTBNZP3EwyMrv3I1acCP5/ymSpcEH9N2ABchS7gLFTl0lO/t/ jVhRL318jfrjInWLsUkZzouDm7dvwfhjqzrr1qz9cjJaksctdMKQu0KlVzN3JH40vf05 nPe08BtROVXoONUVRGM07gN+nogdL+3m70akYWxafl0WQ1ZCf7g6dFGlDQrfZXL6pj5L CfTA== X-Gm-Message-State: AOJu0Yy9TzFlsjLnK4+DsuukasVyyxC58ZfpRxkGA009QSzc85FD7Wpl dpgqfx9N7RMOR+mr/QmAZRQpA4YvpoThC8FLbXUTXntOqBhP6GmIYNT0cGdqU4Q/ChLNVQqr2Wq kkQ== X-Google-Smtp-Source: AGHT+IHjUKa1nv9uxYyRm52pT0+/owWKJiY3yx8RXp0R/3BPpndpV0UQyMPN6s483fsk7rWEqP1ouA== X-Received: by 2002:a05:600c:5249:b0:426:623f:34ae with SMTP id 5b1f17b1804b1-428e6b009e4mr14254845e9.16.1722582755775; Fri, 02 Aug 2024 00:12:35 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:35 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 16/26] ada: Ensure variable is initialized before use Date: Fri, 2 Aug 2024 09:11:33 +0200 Message-ID: <20240802071210.413366-16-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Ronan Desplanques This patch is motivated by a GNAT SAS report. gcc/ada/ * scng.adb (Slit): Initialize object in uncommon path. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/scng.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb index c9ccc4d9b52..08ce2ab5ad1 100644 --- a/gcc/ada/scng.adb +++ b/gcc/ada/scng.adb @@ -1166,6 +1166,7 @@ package body Scng is when '\' | '"' | '{' | '}' => Code := Get_Char_Code (C); when others => + Code := Get_Char_Code ('?'); Error_Msg_S ("illegal escaped character"); end case; From patchwork Fri Aug 2 07:11:34 2024 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: 95179 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 042B2385E827 for ; Fri, 2 Aug 2024 07:22:53 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 140A6385DDF3 for ; Fri, 2 Aug 2024 07:12:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 140A6385DDF3 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 140A6385DDF3 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::231 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582769; cv=none; b=dlQBaxUn1D5b6QatXVhQF7kn1zORW/Ek79WVk8J9AkFjGKG6RtNG0ULjOiN1dikeLMih19Oy8byMKEfr50D+zMaILjdjKjm6ckfPzW9iaQ7A3bIOxxuue4RUJTCovVZHkvTCtbPOZmSUYlPoRiwzsk8bO19Ag9BGeuLZ0ITSahY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582769; c=relaxed/simple; bh=G5G1RgkslIEu2vv9ZxwgykhaFxC1FkASWgzPv9wx0Uw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Uyc9RIBS/AEkZtTLy4sRAtu6HTYLdsp465U3JQbLLZle/Gfl42WBL+/030g1DZtDmkYCYPLRDT018wYObDkIiO0DGGZ5K/YxQgdxJgy1w4W8TpQmHV1kK9/fky2cHvie/2+eHr78vNhUDhCdglis38AOS9FrJdv0wZqQVDqsTOI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ee920b0781so84030681fa.1 for ; Fri, 02 Aug 2024 00:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582759; x=1723187559; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HaKKrzmb1ylNVyLn4dsja04IhYO9oCoDbNqMfHbRuHg=; b=jm5VHqbjYygIooMnxNIORaXQbvOAgbLdtcB6UH0V/2oIWk8quNffHDORVJ0lzUWrun RfDM8/GrTgpYVHp8nf5lTI3y6W6XA25zNUTEkRW1DY9T86rQzUQ4eD9vVqPqviIU+F+6 t+WNKemf54i0LgCxg+IY5ymIlKWNdydeQTounUES3EkX4YPuzL+YAMMiQLnmmz1kbU3Y xYtGTin88+4uq7SzX4Lh0TBS/EBFScjaSvclU0xtt1zVg3pSC8a4/iLIDdi76dzpkCbX zRWx9APz/F5BKR+1hJcn0V9gwqiz8NfL6isrNwolbXZraB2rzEirRRmXZsr8pTqd0wUR 0OXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582759; x=1723187559; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HaKKrzmb1ylNVyLn4dsja04IhYO9oCoDbNqMfHbRuHg=; b=FAkKLsWhZHhb4h438oxBxnQAg2Y5ji5h9ZwMoW7QRUQkR69FeW+0cRgeNK6CmGkTC2 4A6EW0jkkCsGJz2nQUXxGzq3JNg0nxpi5jHDk1dP+vZtjvR1Gj3hSIc7BPuL16ELitgm dLCaIzQuEI1ZsmcPY6rkq4JH1vD80XI1f8NQHJdTB6qx7xkBmGVjluVysw1Sx1ylN90Q ZznO0LlddD9RgJ0jLK8Vfwb76YS/pkbyC5rzhpdgBc+IOhmHM3KqcWoNYy91oVgUUuvM 5690X7fRdXQvaZvHyqdcaiM3rVPqcCS34okvq//8tMa9bZoGwLLgRVTBDJGEQFtEEJeO dgWg== X-Gm-Message-State: AOJu0YxbONrgYNceaWqlQblRpNxsDvyIAl9k0yVx/T2a7p48LV0bx7xA CGpjaPCOUVqWc8oEDrkv442PXYOlM4G/yR/d4qWW53a2e9+5MxtFCaBiMnG/WmLZhEObNhYGJUC 1AA== X-Google-Smtp-Source: AGHT+IHd+4UKTUHpa8CWf+pQ6zHBYwiClDHN6To+VGyUhnmId7ovFAOXe+Rmlgk+vkJZS/X7vramZg== X-Received: by 2002:a2e:9081:0:b0:2ef:2ed2:25b1 with SMTP id 38308e7fff4ca-2f15aaba811mr17464711fa.20.1722582756930; Fri, 02 Aug 2024 00:12:36 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:36 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [COMMITTED 17/26] ada: Add contracts to Ada.Strings.Unbounded and adapt implementation Date: Fri, 2 Aug 2024 09:11:34 +0200 Message-ID: <20240802071210.413366-17-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FILL_THIS_FORM_LOAN, GIT_PATCH_0, KAM_ASCII_DIVIDERS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Yannick Moy Add complete functional contracts to all subprograms in Ada.Strings.Unbounded, except Count, following the specification from Ada RM A.4.5. These contracts are similar to the contracts found in Ada.Strings.Fixed and Ada.Strings.Bounded. A difference is that type Unbounded_String is controlled, thus we avoid performing copies of a parameter Source with Source'Old, and instead apply 'Old attribute on the enclosing call, such as Length(Source)'Old. As Unbounded_String is controlled, the implementation is not in SPARK. Instead, we have separately proved a slightly different implementation for which Unbounded_String is not controlled, against the same specification. This ensures that the specification is consistent. To minimize differences between this test from the SPARK testsuite and the actual implementation (the one in a-strunb.adb), and to avoid overflows in the actual implementation, some code is slightly rewritten. Delete and Insert are modified to return the correct result in all cases allowed by the standard. The same contracts are added to the version in a-strunb__shared.ads and similar implementation patches are applied to the body a-strunb__shared.adb. In particular, tests are added to avoid overflows on strings for which the last index is Natural'Last, and the computations that involve Sum to guarantee that an exception is raised in case of overflow are rewritten to guarantee correct detection and no intermediate overflows (and such tests are applied consistently between the procedure and the function when both exist). gcc/ada/ * libgnat/a-strunb.adb (Sum, Saturated_Sum, Saturated_Mul): Adapt function signatures to more precise types that allow proof. (function "&"): Conditionally assign a slice to avoid possible overflow which only occurs when the assignment is a noop (because the slice is empty in that case). (Append): Same. (function "*"): Retype K to avoid a possible overflow. Add early return on null length for proof. (Delete): Fix implementation to return the correct result in all cases allowed by the Ada standard. (Insert): Same. Also avoid possible overflows. (Length): Rewrite as expression function for proof. (Overwrite): Avoid possible overflows. (Slice): Same. (To_String): Rewrite as expression function for proof. * libgnat/a-strunb.ads: Extend Assertion_Policy to new contracts used. Add complete functional contracts to all subprograms of the public API except Count. * libgnat/a-strunb__shared.adb (Sum): Adapt function signature to more precise types that allow proof. (function "&"): Conditionally assign a slice to avoid possible overflow. (function "*"): Retype K to avoid a possible overflow. (Delete): Fix implementation to return the correct result in all cases allowed by the Ada standard. (Insert): Avoid possible overflows. (Overwrite): Avoid possible overflows. (Replace_Slice): Same. (Slice): Same. (To_String): Rewrite as expression function for proof. * libgnat/a-strunb__shared.ads: Extend Assertion_Policy to new contracts used. Add complete functional contracts to all subprograms of the public API except Count. Mark public part of spec as in SPARK. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/a-strunb.adb | 110 +-- gcc/ada/libgnat/a-strunb.ads | 1039 ++++++++++++++++++++++++-- gcc/ada/libgnat/a-strunb__shared.adb | 150 ++-- gcc/ada/libgnat/a-strunb__shared.ads | 1029 +++++++++++++++++++++++-- 4 files changed, 2068 insertions(+), 260 deletions(-) diff --git a/gcc/ada/libgnat/a-strunb.adb b/gcc/ada/libgnat/a-strunb.adb index c3d4c71271b..163906ed5cd 100644 --- a/gcc/ada/libgnat/a-strunb.adb +++ b/gcc/ada/libgnat/a-strunb.adb @@ -30,22 +30,21 @@ ------------------------------------------------------------------------------ with Ada.Strings.Fixed; -with Ada.Strings.Search; with Ada.Unchecked_Deallocation; package body Ada.Strings.Unbounded is - function Sum (Left : Natural; Right : Integer) return Natural with Inline; + function Sum (Left, Right : Natural) return Natural with Inline; -- Returns summary of Left and Right, raise Constraint_Error on overflow function Mul (Left, Right : Natural) return Natural with Inline; -- Returns multiplication of Left and Right, raise Constraint_Error on -- overflow. - function Saturated_Sum (Left : Natural; Right : Integer) return Natural; + function Saturated_Sum (Left, Right : Natural) return Natural; -- Returns summary of Left and Right or Natural'Last on overflow - function Saturated_Mul (Left, Right : Natural) return Natural; + function Saturated_Mul (Left, Right : Positive) return Positive; -- Returns multiplication of Left and Right or Natural'Last on overflow --------- @@ -67,8 +66,11 @@ package body Ada.Strings.Unbounded is Result.Reference (1 .. L_Length) := Left.Reference (1 .. Left.Last); - Result.Reference (L_Length + 1 .. Result.Last) := - Right.Reference (1 .. Right.Last); + + if L_Length < Natural'Last then + Result.Reference (L_Length + 1 .. Result.Last) := + Right.Reference (1 .. Right.Last); + end if; return Result; end "&"; @@ -86,7 +88,10 @@ package body Ada.Strings.Unbounded is Result.Reference := new String (1 .. Result.Last); Result.Reference (1 .. L_Length) := Left.Reference (1 .. Left.Last); - Result.Reference (L_Length + 1 .. Result.Last) := Right; + + if L_Length < Natural'Last then + Result.Reference (L_Length + 1 .. Result.Last) := Right; + end if; return Result; end "&"; @@ -104,8 +109,11 @@ package body Ada.Strings.Unbounded is Result.Reference := new String (1 .. Result.Last); Result.Reference (1 .. Left'Length) := Left; - Result.Reference (Left'Length + 1 .. Result.Last) := - Right.Reference (1 .. Right.Last); + + if Left'Length < Natural'Last then + Result.Reference (Left'Length + 1 .. Result.Last) := + Right.Reference (1 .. Right.Last); + end if; return Result; end "&"; @@ -170,17 +178,21 @@ package body Ada.Strings.Unbounded is Right : String) return Unbounded_String is Len : constant Natural := Right'Length; - K : Positive; + K : Natural; Result : Unbounded_String; begin + if Len = 0 then + return Null_Unbounded_String; + end if; + Result.Last := Mul (Left, Len); Result.Reference := new String (1 .. Result.Last); - K := 1; + K := 0; for J in 1 .. Left loop - Result.Reference (K .. K + Len - 1) := Right; + Result.Reference (K + 1 .. K + Len) := Right; K := K + Len; end loop; @@ -192,17 +204,21 @@ package body Ada.Strings.Unbounded is Right : Unbounded_String) return Unbounded_String is Len : constant Natural := Right.Last; - K : Positive; + K : Natural; Result : Unbounded_String; begin + if Len = 0 then + return Null_Unbounded_String; + end if; + Result.Last := Mul (Left, Len); Result.Reference := new String (1 .. Result.Last); - K := 1; + K := 0; for J in 1 .. Left loop - Result.Reference (K .. K + Len - 1) := + Result.Reference (K + 1 .. K + Len) := Right.Reference (1 .. Right.Last); K := K + Len; end loop; @@ -380,8 +396,12 @@ package body Ada.Strings.Unbounded is is begin Realloc_For_Chunk (Source, New_Item.Last); - Source.Reference (Source.Last + 1 .. Source.Last + New_Item.Last) := - New_Item.Reference (1 .. New_Item.Last); + + if Source.Last < Natural'Last then + Source.Reference (Source.Last + 1 .. Source.Last + New_Item.Last) := + New_Item.Reference (1 .. New_Item.Last); + end if; + Source.Last := Source.Last + New_Item.Last; end Append; @@ -391,8 +411,12 @@ package body Ada.Strings.Unbounded is is begin Realloc_For_Chunk (Source, New_Item'Length); - Source.Reference (Source.Last + 1 .. Source.Last + New_Item'Length) := - New_Item; + + if Source.Last < Natural'Last then + Source.Reference (Source.Last + 1 .. Source.Last + New_Item'Length) := + New_Item; + end if; + Source.Last := Source.Last + New_Item'Length; end Append; @@ -462,16 +486,20 @@ package body Ada.Strings.Unbounded is if From > Through then null; - elsif From < Source.Reference'First or else Through > Source.Last then + elsif From - 1 > Source.Last then raise Index_Error; else declare - Len : constant Natural := Through - From + 1; + Len : constant Natural := + Natural'Min (Source.Last, Through) - From + 1; begin - Source.Reference (From .. Source.Last - Len) := - Source.Reference (Through + 1 .. Source.Last); + if Through < Natural'Last then + Source.Reference (From .. Source.Last - Len) := + Source.Reference (Through + 1 .. Source.Last); + end if; + Source.Last := Source.Last - Len; end; end if; @@ -714,17 +742,19 @@ package body Ada.Strings.Unbounded is New_Item : String) is begin - if Before not in Source.Reference'First .. Source.Last + 1 then + if Before - 1 > Source.Last then raise Index_Error; end if; Realloc_For_Chunk (Source, New_Item'Length); - Source.Reference - (Before + New_Item'Length .. Source.Last + New_Item'Length) := - Source.Reference (Before .. Source.Last); + if Before <= Source.Last then + Source.Reference + (Before + New_Item'Length .. Source.Last + New_Item'Length) := + Source.Reference (Before .. Source.Last); + end if; - Source.Reference (Before .. Before + New_Item'Length - 1) := New_Item; + Source.Reference (Before .. Before - 1 + New_Item'Length) := New_Item; Source.Last := Source.Last + New_Item'Length; end Insert; @@ -733,9 +763,7 @@ package body Ada.Strings.Unbounded is ------------ function Length (Source : Unbounded_String) return Natural is - begin - return Source.Last; - end Length; + (Source.Last); --------- -- Mul -- @@ -769,8 +797,8 @@ package body Ada.Strings.Unbounded is is NL : constant Natural := New_Item'Length; begin - if Position <= Source.Last - NL + 1 then - Source.Reference (Position .. Position + NL - 1) := New_Item; + if Position - 1 <= Source.Last - NL then + Source.Reference (Position .. Position - 1 + NL) := New_Item; else declare Old : String_Access := Source.Reference; @@ -897,7 +925,7 @@ package body Ada.Strings.Unbounded is -- Saturated_Mul -- ------------------- - function Saturated_Mul (Left, Right : Natural) return Natural is + function Saturated_Mul (Left, Right : Positive) return Positive is begin return Mul (Left, Right); exception @@ -905,11 +933,11 @@ package body Ada.Strings.Unbounded is return Natural'Last; end Saturated_Mul; - ----------------- + ------------------- -- Saturated_Sum -- - ----------------- + ------------------- - function Saturated_Sum (Left : Natural; Right : Integer) return Natural is + function Saturated_Sum (Left, Right : Natural) return Natural is begin return Sum (Left, Right); exception @@ -945,7 +973,7 @@ package body Ada.Strings.Unbounded is begin -- Note: test of High > Length is in accordance with AI95-00128 - if Low > Source.Last + 1 or else High > Source.Last then + if Low - 1 > Source.Last or else High > Source.Last then raise Index_Error; else return Source.Reference (Low .. High); @@ -956,7 +984,7 @@ package body Ada.Strings.Unbounded is -- Sum -- --------- - function Sum (Left : Natural; Right : Integer) return Natural is + function Sum (Left, Right : Natural) return Natural is pragma Unsuppress (Overflow_Check); begin return Left + Right; @@ -993,9 +1021,7 @@ package body Ada.Strings.Unbounded is --------------- function To_String (Source : Unbounded_String) return String is - begin - return Source.Reference (1 .. Source.Last); - end To_String; + (Source.Reference (1 .. Source.Last)); ------------------------- -- To_Unbounded_String -- diff --git a/gcc/ada/libgnat/a-strunb.ads b/gcc/ada/libgnat/a-strunb.ads index 385544ecb57..981f406a767 100644 --- a/gcc/ada/libgnat/a-strunb.ads +++ b/gcc/ada/libgnat/a-strunb.ads @@ -35,12 +35,18 @@ -- Preconditions in this unit are meant for analysis only, not for run-time -- checking, so that the expected exceptions are raised. This is enforced by --- setting the corresponding assertion policy to Ignore. +-- setting the corresponding assertion policy to Ignore. Postconditions and +-- contract cases should not be executed at runtime as well, in order not to +-- slow down the execution of these functions. -pragma Assertion_Policy (Pre => Ignore); +pragma Assertion_Policy (Pre => Ignore, + Post => Ignore, + Contract_Cases => Ignore, + Ghost => Ignore); -with Ada.Strings.Maps; +with Ada.Strings.Maps; use type Ada.Strings.Maps.Character_Mapping_Function; with Ada.Finalization; +with Ada.Strings.Search; private with Ada.Strings.Text_Buffers; -- The language-defined package Strings.Unbounded provides a private type @@ -59,6 +65,13 @@ package Ada.Strings.Unbounded with is pragma Preelaborate; + -- Contracts may call function Length in the prefix of attribute reference + -- to Old as in Length (Source)'Old. Allow this use. + + pragma Unevaluated_Use_Of_Old (Allow); + + subtype String_1 is String (1 .. <>) with Ghost; -- Type used in contracts + type Unbounded_String is private with Default_Initial_Condition => Length (Unbounded_String) = 0; pragma Preelaborable_Initialization (Unbounded_String); @@ -84,9 +97,10 @@ is -------------------------------------------------------- function To_Unbounded_String - (Source : String) return Unbounded_String + (Source : String) return Unbounded_String with - Post => To_String (To_Unbounded_String'Result) = Source, + Post => To_String (To_Unbounded_String'Result) = Source + and then Length (To_Unbounded_String'Result) = Source'Length, Global => null; -- Returns an Unbounded_String that represents Source @@ -126,7 +140,8 @@ is New_Item : Unbounded_String) with Pre => Length (New_Item) <= Natural'Last - Length (Source), - Post => Length (Source) = Length (Source)'Old + Length (New_Item), + Post => + To_String (Source) = To_String (Source)'Old & To_String (New_Item), Global => null; procedure Append @@ -134,7 +149,7 @@ is New_Item : String) with Pre => New_Item'Length <= Natural'Last - Length (Source), - Post => Length (Source) = Length (Source)'Old + New_Item'Length, + Post => To_String (Source) = To_String (Source)'Old & New_Item, Global => null; procedure Append @@ -142,7 +157,7 @@ is New_Item : Character) with Pre => Length (Source) < Natural'Last, - Post => Length (Source) = Length (Source)'Old + 1, + Post => To_String (Source) = To_String (Source)'Old & New_Item, Global => null; -- For each of the Append procedures, the resulting string represented by @@ -154,7 +169,7 @@ is Right : Unbounded_String) return Unbounded_String with Pre => Length (Right) <= Natural'Last - Length (Left), - Post => Length ("&"'Result) = Length (Left) + Length (Right), + Post => To_String ("&"'Result) = To_String (Left) & To_String (Right), Global => null; function "&" @@ -162,7 +177,7 @@ is Right : String) return Unbounded_String with Pre => Right'Length <= Natural'Last - Length (Left), - Post => Length ("&"'Result) = Length (Left) + Right'Length, + Post => To_String ("&"'Result) = To_String (Left) & Right, Global => null; function "&" @@ -170,7 +185,7 @@ is Right : Unbounded_String) return Unbounded_String with Pre => Left'Length <= Natural'Last - Length (Right), - Post => Length ("&"'Result) = Left'Length + Length (Right), + Post => To_String ("&"'Result) = String_1 (Left) & To_String (Right), Global => null; function "&" @@ -178,7 +193,7 @@ is Right : Character) return Unbounded_String with Pre => Length (Left) < Natural'Last, - Post => Length ("&"'Result) = Length (Left) + 1, + Post => To_String ("&"'Result) = To_String (Left) & Right, Global => null; function "&" @@ -186,7 +201,7 @@ is Right : Unbounded_String) return Unbounded_String with Pre => Length (Right) < Natural'Last, - Post => Length ("&"'Result) = Length (Right) + 1, + Post => To_String ("&"'Result) = Left & To_String (Right), Global => null; -- Each of the "&" functions returns an Unbounded_String obtained by @@ -211,7 +226,8 @@ is By : Character) with Pre => Index <= Length (Source), - Post => Length (Source) = Length (Source)'Old, + Post => + To_String (Source) = (To_String (Source)'Old with delta Index => By), Global => null; -- Updates Source such that the character at position Index in the string -- represented by Source is By; propagates Index_Error if @@ -223,7 +239,9 @@ is High : Natural) return String with Pre => Low - 1 <= Length (Source) and then High <= Length (Source), - Post => Slice'Result'Length = Natural'Max (0, High - Low + 1), + Post => Slice'Result'First = Low + and then Slice'Result'Last = High + and then Slice'Result = To_String (Source) (Low .. High), Global => null; -- Returns the slice at positions Low through High in the string -- represented by Source; propagates Index_Error if @@ -237,7 +255,7 @@ is with Pre => Low - 1 <= Length (Source) and then High <= Length (Source), Post => - Length (Unbounded_Slice'Result) = Natural'Max (0, High - Low + 1), + To_String (Unbounded_Slice'Result) = To_String (Source) (Low .. High), Global => null; pragma Ada_05 (Unbounded_Slice); -- Returns the slice at positions Low through High in the string @@ -251,7 +269,7 @@ is High : Natural) with Pre => Low - 1 <= Length (Source) and then High <= Length (Source), - Post => Length (Target) = Natural'Max (0, High - Low + 1), + Post => To_String (Target) = To_String (Source) (Low .. High), Global => null; pragma Ada_05 (Unbounded_Slice); -- Sets Target to the Unbounded_String representing the slice at positions @@ -283,72 +301,84 @@ is (Left : Unbounded_String; Right : Unbounded_String) return Boolean with + Post => "<"'Result = (To_String (Left) < To_String (Right)), Global => null; function "<" (Left : Unbounded_String; Right : String) return Boolean with + Post => "<"'Result = (To_String (Left) < Right), Global => null; function "<" (Left : String; Right : Unbounded_String) return Boolean with + Post => "<"'Result = (Left < To_String (Right)), Global => null; function "<=" (Left : Unbounded_String; Right : Unbounded_String) return Boolean with + Post => "<="'Result = (To_String (Left) <= To_String (Right)), Global => null; function "<=" (Left : Unbounded_String; Right : String) return Boolean with + Post => "<="'Result = (To_String (Left) <= Right), Global => null; function "<=" (Left : String; Right : Unbounded_String) return Boolean with + Post => "<="'Result = (Left <= To_String (Right)), Global => null; function ">" (Left : Unbounded_String; Right : Unbounded_String) return Boolean with + Post => ">"'Result = (To_String (Left) > To_String (Right)), Global => null; function ">" (Left : Unbounded_String; Right : String) return Boolean with + Post => ">"'Result = (To_String (Left) > Right), Global => null; function ">" (Left : String; Right : Unbounded_String) return Boolean with + Post => ">"'Result = (Left > To_String (Right)), Global => null; function ">=" (Left : Unbounded_String; Right : Unbounded_String) return Boolean with + Post => ">="'Result = (To_String (Left) >= To_String (Right)), Global => null; function ">=" (Left : Unbounded_String; Right : String) return Boolean with + Post => ">="'Result = (To_String (Left) >= Right), Global => null; function ">=" (Left : String; Right : Unbounded_String) return Boolean with + Post => ">="'Result = (Left >= To_String (Right)), Global => null; -- Each of the functions "=", "<", ">", "<=", and ">=" returns the same @@ -365,8 +395,52 @@ is Going : Direction := Forward; Mapping : Maps.Character_Mapping := Maps.Identity) return Natural with - Pre => Pattern'Length /= 0, - Global => null; + Pre => Pattern'Length > 0, + Post => Index'Result <= Length (Source), + Contract_Cases => + + -- If Source is the empty string, then 0 is returned + + (Length (Source) = 0 + => + Index'Result = 0, + + -- If some slice of Source matches Pattern, then a valid index is + -- returned. + + Length (Source) > 0 + and then + (for some J in 1 .. Length (Source) - (Pattern'Length - 1) => + Search.Match (To_String (Source), Pattern, Mapping, J)) + => + -- The result is in the considered range of Source + + Index'Result in 1 .. Length (Source) - (Pattern'Length - 1) + + -- The slice beginning at the returned index matches Pattern + + and then Search.Match + (To_String (Source), Pattern, Mapping, Index'Result) + + -- The result is the smallest or largest index which satisfies + -- the matching, respectively when Going = Forward and Going = + -- Backward. + + and then + (for all J in 1 .. Length (Source) => + (if (if Going = Forward + then J <= Index'Result - 1 + else J - 1 in Index'Result + .. Length (Source) - Pattern'Length) + then not (Search.Match + (To_String (Source), Pattern, Mapping, J)))), + + -- Otherwise, 0 is returned + + others + => + Index'Result = 0), + Global => null; function Index (Source : Unbounded_String; @@ -374,8 +448,52 @@ is Going : Direction := Forward; Mapping : Maps.Character_Mapping_Function) return Natural with - Pre => Pattern'Length /= 0, - Global => null; + Pre => Pattern'Length /= 0 and then Mapping /= null, + Post => Index'Result <= Length (Source), + Contract_Cases => + + -- If Source is the empty string, then 0 is returned + + (Length (Source) = 0 + => + Index'Result = 0, + + -- If some slice of Source matches Pattern, then a valid index is + -- returned. + + Length (Source) > 0 + and then + (for some J in 1 .. Length (Source) - (Pattern'Length - 1) => + Search.Match (To_String (Source), Pattern, Mapping, J)) + => + -- The result is in the considered range of Source + + Index'Result in 1 .. Length (Source) - (Pattern'Length - 1) + + -- The slice beginning at the returned index matches Pattern + + and then Search.Match + (To_String (Source), Pattern, Mapping, Index'Result) + + -- The result is the smallest or largest index which satisfies + -- the matching, respectively when Going = Forward and Going = + -- Backward. + + and then + (for all J in 1 .. Length (Source) => + (if (if Going = Forward + then J <= Index'Result - 1 + else J - 1 in Index'Result + .. Length (Source) - Pattern'Length) + then not (Search.Match + (To_String (Source), Pattern, Mapping, J)))), + + -- Otherwise, 0 is returned + + others + => + Index'Result = 0), + Global => null; function Index (Source : Unbounded_String; @@ -383,7 +501,43 @@ is Test : Membership := Inside; Going : Direction := Forward) return Natural with - Global => null; + Post => Index'Result <= Length (Source), + Contract_Cases => + + -- If no character of Source satisfies the property Test on Set, + -- then 0 is returned. + + ((for all C of To_String (Source) => + (Test = Inside) /= Maps.Is_In (C, Set)) + => + Index'Result = 0, + + -- Otherwise, an index in the range of Source is returned + + others + => + -- The result is in the range of Source + + Index'Result in 1 .. Length (Source) + + -- The character at the returned index satisfies the property + -- Test on Set. + + and then + (Test = Inside) = + Maps.Is_In (Element (Source, Index'Result), Set) + + -- The result is the smallest or largest index which satisfies + -- the property, respectively when Going = Forward and Going = + -- Backward. + + and then + (for all J in 1 .. Length (Source) => + (if J /= Index'Result + and then (J < Index'Result) = (Going = Forward) + then (Test = Inside) + /= Maps.Is_In (Element (Source, J), Set)))), + Global => null; function Index (Source : Unbounded_String; @@ -392,9 +546,60 @@ is Going : Direction := Forward; Mapping : Maps.Character_Mapping := Maps.Identity) return Natural with - Pre => (if Length (Source) /= 0 then From <= Length (Source)) - and then Pattern'Length /= 0, - Global => null; + Pre => + (if Length (Source) /= 0 then From <= Length (Source)) + and then Pattern'Length /= 0, + Post => Index'Result <= Length (Source), + Contract_Cases => + + -- If Source is the empty string, then 0 is returned + + (Length (Source) = 0 + => + Index'Result = 0, + + -- If some slice of Source matches Pattern, then a valid index is + -- returned. + + Length (Source) > 0 + and then + (for some J in + (if Going = Forward then From else 1) + .. (if Going = Forward then Length (Source) else From) + - (Pattern'Length - 1) => + Search.Match (To_String (Source), Pattern, Mapping, J)) + => + -- The result is in the considered range of Source + + Index'Result in + (if Going = Forward then From else 1) + .. (if Going = Forward then Length (Source) else From) + - (Pattern'Length - 1) + + -- The slice beginning at the returned index matches Pattern + + and then Search.Match + (To_String (Source), Pattern, Mapping, Index'Result) + + -- The result is the smallest or largest index which satisfies + -- the matching, respectively when Going = Forward and Going = + -- Backward. + + and then + (for all J in 1 .. Length (Source) => + (if (if Going = Forward + then J in From .. Index'Result - 1 + else J - 1 in Index'Result + .. From - Pattern'Length) + then not (Search.Match + (To_String (Source), Pattern, Mapping, J)))), + + -- Otherwise, 0 is returned + + others + => + Index'Result = 0), + Global => null; pragma Ada_05 (Index); function Index @@ -404,9 +609,61 @@ is Going : Direction := Forward; Mapping : Maps.Character_Mapping_Function) return Natural with - Pre => (if Length (Source) /= 0 then From <= Length (Source)) - and then Pattern'Length /= 0, - Global => null; + Pre => + (if Length (Source) /= 0 then From <= Length (Source)) + and then Pattern'Length /= 0 + and then Mapping /= null, + Post => Index'Result <= Length (Source), + Contract_Cases => + + -- If Source is the empty string, then 0 is returned + + (Length (Source) = 0 + => + Index'Result = 0, + + -- If some slice of Source matches Pattern, then a valid index is + -- returned. + + Length (Source) > 0 + and then + (for some J in + (if Going = Forward then From else 1) + .. (if Going = Forward then Length (Source) else From) + - (Pattern'Length - 1) => + Search.Match (To_String (Source), Pattern, Mapping, J)) + => + -- The result is in the considered range of Source + + Index'Result in + (if Going = Forward then From else 1) + .. (if Going = Forward then Length (Source) else From) + - (Pattern'Length - 1) + + -- The slice beginning at the returned index matches Pattern + + and then Search.Match + (To_String (Source), Pattern, Mapping, Index'Result) + + -- The result is the smallest or largest index which satisfies + -- the matching, respectively when Going = Forward and Going = + -- Backward. + + and then + (for all J in 1 .. Length (Source) => + (if (if Going = Forward + then J in From .. Index'Result - 1 + else J - 1 in Index'Result + .. From - Pattern'Length) + then not (Search.Match + (To_String (Source), Pattern, Mapping, J)))), + + -- Otherwise, 0 is returned + + others + => + Index'Result = 0), + Global => null; pragma Ada_05 (Index); function Index @@ -416,23 +673,147 @@ is Test : Membership := Inside; Going : Direction := Forward) return Natural with - Pre => (if Length (Source) /= 0 then From <= Length (Source)), - Global => null; + Pre => + (if Length (Source) /= 0 then From <= Length (Source)), + Post => Index'Result <= Length (Source), + Contract_Cases => + + -- If Source is the empty string, or no character of the considered + -- slice of Source satisfies the property Test on Set, then 0 is + -- returned. + + (Length (Source) = 0 + or else + (for all J in 1 .. Length (Source) => + (if J = From or else (J > From) = (Going = Forward) then + (Test = Inside) /= Maps.Is_In (Element (Source, J), Set))) + => + Index'Result = 0, + + -- Otherwise, an index in the considered range of Source is + -- returned. + + others + => + -- The result is in the considered range of Source + + Index'Result in 1 .. Length (Source) + and then + (Index'Result = From + or else (Index'Result > From) = (Going = Forward)) + + -- The character at the returned index satisfies the property + -- Test on Set. + + and then + (Test = Inside) = + Maps.Is_In (Element (Source, Index'Result), Set) + + -- The result is the smallest or largest index which satisfies + -- the property, respectively when Going = Forward and Going = + -- Backward. + + and then + (for all J in 1 .. Length (Source) => + (if J /= Index'Result + and then (J < Index'Result) = (Going = Forward) + and then (J = From + or else (J > From) = (Going = Forward)) + then (Test = Inside) + /= Maps.Is_In (Element (Source, J), Set)))), + Global => null; pragma Ada_05 (Index); function Index_Non_Blank (Source : Unbounded_String; Going : Direction := Forward) return Natural with - Global => null; + Post => Index_Non_Blank'Result <= Length (Source), + Contract_Cases => + + -- If all characters of Source are Space characters, then 0 is + -- returned. + + ((for all C of To_String (Source) => C = ' ') + => + Index_Non_Blank'Result = 0, + + -- Otherwise, an index in the range of Source is returned + + others + => + -- The result is in the range of Source + + Index_Non_Blank'Result in 1 .. Length (Source) + + -- The character at the returned index is not a Space character + + and then Element (Source, Index_Non_Blank'Result) /= ' ' + + -- The result is the smallest or largest index which is not a + -- Space character, respectively when Going = Forward and Going + -- = Backward. + + and then + (for all J in 1 .. Length (Source) => + (if J /= Index_Non_Blank'Result + and then + (J < Index_Non_Blank'Result) = (Going = Forward) + then Element (Source, J) = ' '))), + Global => null; function Index_Non_Blank (Source : Unbounded_String; From : Positive; Going : Direction := Forward) return Natural with - Pre => (if Length (Source) /= 0 then From <= Length (Source)), - Global => null; + Pre => + (if Length (Source) /= 0 then From <= Length (Source)), + Post => Index_Non_Blank'Result <= Length (Source), + Contract_Cases => + + -- If Source is the empty string, or all characters of the + -- considered slice of Source are Space characters, then 0 + -- is returned. + + (Length (Source) = 0 + or else + (for all J in 1 .. Length (Source) => + (if J = From or else (J > From) = (Going = Forward) then + Element (Source, J) = ' ')) + => + Index_Non_Blank'Result = 0, + + -- Otherwise, an index in the considered range of Source is + -- returned. + + others + => + -- The result is in the considered range of Source + + Index_Non_Blank'Result in 1 .. Length (Source) + and then + (Index_Non_Blank'Result = From + or else + (Index_Non_Blank'Result > From) = (Going = Forward)) + + -- The character at the returned index is not a Space character + + and then Element (Source, Index_Non_Blank'Result) /= ' ' + + -- The result is the smallest or largest index which isn't a + -- Space character, respectively when Going = Forward and Going + -- = Backward. + + and then + (for all J in 1 .. Length (Source) => + (if J /= Index_Non_Blank'Result + and then + (J < Index_Non_Blank'Result) = (Going = Forward) + and then (J = From + or else (J > From) = (Going = Forward)) + then Element (Source, J) = ' '))), + Global => null; pragma Ada_05 (Index_Non_Blank); function Count @@ -448,7 +829,7 @@ is Pattern : String; Mapping : Maps.Character_Mapping_Function) return Natural with - Pre => Pattern'Length /= 0, + Pre => Pattern'Length /= 0 and then Mapping /= null, Global => null; function Count @@ -465,8 +846,53 @@ is First : out Positive; Last : out Natural) with - Pre => (if Length (Source) /= 0 then From <= Length (Source)), - Global => null; + Pre => + (if Length (Source) /= 0 then From <= Length (Source)), + Contract_Cases => + + -- If Source is the empty string, or if no character of the + -- considered slice of Source satisfies the property Test on + -- Set, then First is set to From and Last is set to 0. + + (Length (Source) = 0 + or else + (for all J in From .. Length (Source) => + (Test = Inside) /= Maps.Is_In (Element (Source, J), Set)) + => + First = From and then Last = 0, + + -- Otherwise, First and Last are set to valid indexes + + others + => + -- First and Last are in the considered range of Source + + First in From .. Length (Source) + and then Last in First .. Length (Source) + + -- No character between From and First satisfies the property + -- Test on Set. + + and then + (for all J in From .. First - 1 => + (Test = Inside) /= Maps.Is_In (Element (Source, J), Set)) + + -- All characters between First and Last satisfy the property + -- Test on Set. + + and then + (for all J in First .. Last => + (Test = Inside) = Maps.Is_In (Element (Source, J), Set)) + + -- If Last is not Source'Last, then the character at position + -- Last + 1 does not satify the property Test on Set. + + and then + (if Last < Length (Source) + then + (Test = Inside) + /= Maps.Is_In (Element (Source, Last + 1), Set))), + Global => null; pragma Ada_2012 (Find_Token); procedure Find_Token @@ -476,7 +902,51 @@ is First : out Positive; Last : out Natural) with - Global => null; + Contract_Cases => + + -- If Source is the empty string, or if no character of the + -- considered slice of Source satisfies the property Test on + -- Set, then First is set to 1 and Last is set to 0. + + (Length (Source) = 0 + or else + (for all J in 1 .. Length (Source) => + (Test = Inside) /= Maps.Is_In (Element (Source, J), Set)) + => + First = 1 and then Last = 0, + + -- Otherwise, First and Last are set to valid indexes + + others + => + -- First and Last are in the considered range of Source + + First in 1 .. Length (Source) + and then Last in First .. Length (Source) + + -- No character between 1 and First satisfies the property Test + -- on Set. + + and then + (for all J in 1 .. First - 1 => + (Test = Inside) /= Maps.Is_In (Element (Source, J), Set)) + + -- All characters between First and Last satisfy the property + -- Test on Set. + + and then + (for all J in First .. Last => + (Test = Inside) = Maps.Is_In (Element (Source, J), Set)) + + -- If Last is not Source'Last, then the character at position + -- Last + 1 does not satify the property Test on Set. + + and then + (if Last < Length (Source) + then + (Test = Inside) + /= Maps.Is_In (Element (Source, Last + 1), Set))), + Global => null; -- Each of the search subprograms (Index, Index_Non_Blank, Count, -- Find_Token) has the same effect as the corresponding subprogram in @@ -491,28 +961,44 @@ is (Source : Unbounded_String; Mapping : Maps.Character_Mapping) return Unbounded_String with - Post => Length (Translate'Result) = Length (Source), + Post => Length (Translate'Result) = Length (Source) + and then + (for all K in 1 .. Length (Source) => + Element (Translate'Result, K) = + Ada.Strings.Maps.Value (Mapping, Element (Source, K))), Global => null; procedure Translate (Source : in out Unbounded_String; Mapping : Maps.Character_Mapping) with - Post => Length (Source) = Length (Source)'Old, + Post => Length (Source) = Length (Source)'Old + and then + (for all K in 1 .. Length (Source) => + Element (Source, K) = + Ada.Strings.Maps.Value (Mapping, To_String (Source)'Old (K))), Global => null; function Translate (Source : Unbounded_String; Mapping : Maps.Character_Mapping_Function) return Unbounded_String with - Post => Length (Translate'Result) = Length (Source), + Pre => Mapping /= null, + Post => Length (Translate'Result) = Length (Source) + and then + (for all K in 1 .. Length (Source) => + Element (Translate'Result, K) = Mapping (Element (Source, K))), Global => null; procedure Translate (Source : in out Unbounded_String; Mapping : Maps.Character_Mapping_Function) with - Post => Length (Source) = Length (Source)'Old, + Pre => Mapping /= null, + Post => Length (Source) = Length (Source)'Old + and then + (for all K in 1 .. Length (Source) => + Element (Source, K) = Mapping (To_String (Source)'Old (K))), Global => null; -- The Translate function has an analogous effect to the corresponding @@ -535,15 +1021,76 @@ is and then (if High >= Low then Low - 1 <= Natural'Last - By'Length - - Natural'Max (Length (Source) - High, 0) + - Integer'Max (Length (Source) - High, 0) else Length (Source) <= Natural'Last - By'Length), Contract_Cases => + + -- If High >= Low, when considering the application of To_String to + -- convert an Unbounded_String into String, then the returned string + -- comprises Source (Source'First .. Low - 1) & By + -- & Source(High + 1 .. Source'Last). + (High >= Low => + + -- Length of the returned string + Length (Replace_Slice'Result) - = Low - 1 + By'Length + Natural'Max (Length (Source)'Old - High, 0), + = Low - 1 + By'Length + Integer'Max (Length (Source) - High, 0) + + -- Elements starting at Low are replaced by elements of By + + and then + Slice (Replace_Slice'Result, 1, Low - 1) = + Slice (Source, 1, Low - 1) + and then + Slice (Replace_Slice'Result, Low, Low - 1 + By'Length) = By + + -- When there are remaining characters after the replaced slice, + -- they are appended to the result. + + and then + (if High < Length (Source) + then + Slice (Replace_Slice'Result, + Low + By'Length, Length (Replace_Slice'Result)) = + Slice (Source, High + 1, Length (Source))), + + -- If High < Low, then the returned string is + -- Insert (Source, Before => Low, New_Item => By). + others => - Length (Replace_Slice'Result) = Length (Source)'Old + By'Length), + + -- Length of the returned string + + Length (Replace_Slice'Result) = Length (Source) + By'Length + + -- Elements of By are inserted after the element at Low + + and then + Slice (Replace_Slice'Result, 1, Low - 1) = + Slice (Source, 1, Low - 1) + and then + Slice (Replace_Slice'Result, Low, Low - 1 + By'Length) = By + + -- When there are remaining characters after Low in Source, they + -- are appended to the result. + + and then + (if Low < Length (Source) + then + Slice (Replace_Slice'Result, + Low + By'Length, Length (Replace_Slice'Result)) = + Slice (Source, Low, Length (Source)))), Global => null; + -- If Low > Source'Last + 1, or High < Source'First - 1, then Index_Error + -- is propagated. Otherwise: + -- + -- * If High >= Low, then the returned string comprises + -- Source (Source'First .. Low - 1) + -- & By & Source(High + 1 .. Source'Last), but with lower bound 1. + -- + -- * If High < Low, then the returned string is + -- Insert (Source, Before => Low, New_Item => By). procedure Replace_Slice (Source : in out Unbounded_String; @@ -559,11 +1106,61 @@ is - Natural'Max (Length (Source) - High, 0) else Length (Source) <= Natural'Last - By'Length), Contract_Cases => + + -- If High >= Low, when considering the application of To_String to + -- convert an Unbounded_String into String, then the returned string + -- comprises Source (Source'First .. Low - 1) & By + -- & Source(High + 1 .. Source'Last). + (High >= Low => + + -- Length of the returned string + Length (Source) - = Low - 1 + By'Length + Natural'Max (Length (Source)'Old - High, 0), + = Low - 1 + By'Length + Integer'Max (Length (Source)'Old - High, 0) + + -- Elements starting at Low are replaced by elements of By + + and then Slice (Source, 1, Low - 1) = + Slice (Source, 1, Low - 1)'Old + and then Slice (Source, Low, Low - 1 + By'Length) = By + + -- When there are remaining characters after the replaced slice, + -- they are appended to the result. + + and then + (if High < Length (Source)'Old + then Slice (Source, Low + By'Length, Length (Source)) = + Slice (Source, + -- Really "High + 1" but expressed with a conditional + -- repeating the above test so that the call to Slice + -- is valid on entry (under 'Old) even when the test + -- evaluates to False. + (if High < Length (Source) then High + 1 else 1), + Length (Source))'Old), + + -- If High < Low, then the returned string is + -- Insert (Source, Before => Low, New_Item => By). + others => - Length (Source) = Length (Source)'Old + By'Length), + + -- Length of the returned string + + Length (Source) = Length (Source)'Old + By'Length + + -- Elements of By are inserted after the element at Low + + and then Slice (Source, 1, Low - 1) = + Slice (Source, 1, Low - 1)'Old + and then Slice (Source, Low, Low - 1 + By'Length) = By + + -- When there are remaining characters after Low in Source, they + -- are appended to the result. + + and then + (if Low < Length (Source)'Old + then Slice (Source, Low + By'Length, Length (Source)) = + Slice (Source, Low, Length (Source))'Old)), Global => null; function Insert @@ -573,8 +1170,32 @@ is with Pre => Before - 1 <= Length (Source) and then New_Item'Length <= Natural'Last - Length (Source), - Post => Length (Insert'Result) = Length (Source) + New_Item'Length, + Post => + -- Length of the returned string + + Length (Insert'Result) = Length (Source) + New_Item'Length + + -- Elements of New_Item are inserted after element at Before + + and then + Slice (Insert'Result, 1, Before - 1) = Slice (Source, 1, Before - 1) + and then + Slice (Insert'Result, Before, Before - 1 + New_Item'Length) + = New_Item + + -- When there are remaining characters after Before in Source, they + -- are appended to the returned string. + + and then + (if Before <= Length (Source) then + Slice (Insert'Result, Before + New_Item'Length, + Length (Insert'Result)) = + Slice (Source, Before, Length (Source))), Global => null; + -- Propagates Index_Error if Before is not in + -- Source'First .. Source'Last + 1; otherwise, returns + -- Source (Source'First .. Before - 1) + -- & New_Item & Source(Before..Source'Last), but with lower bound 1. procedure Insert (Source : in out Unbounded_String; @@ -583,7 +1204,25 @@ is with Pre => Before - 1 <= Length (Source) and then New_Item'Length <= Natural'Last - Length (Source), - Post => Length (Source) = Length (Source)'Old + New_Item'Length, + Post => + -- Length of the returned string + + Length (Source) = Length (Source)'Old + New_Item'Length + + -- Elements of New_Item are inserted after element at Before + + and then + Slice (Source, 1, Before - 1) = Slice (Source, 1, Before - 1)'Old + and then + Slice (Source, Before, Before - 1 + New_Item'Length) = New_Item + + -- When there are remaining characters after Before in Source, they + -- are appended to the returned string. + + and then + (if Before <= Length (Source)'Old then + Slice (Source, Before + New_Item'Length, Length (Source)) = + Slice (Source, Before, Length (Source))'Old), Global => null; function Overwrite @@ -592,12 +1231,31 @@ is New_Item : String) return Unbounded_String with Pre => Position - 1 <= Length (Source) - and then (if New_Item'Length /= 0 - then - New_Item'Length <= Natural'Last - (Position - 1)), + and then New_Item'Length <= Natural'Last - (Position - 1), Post => - Length (Overwrite'Result) - = Natural'Max (Length (Source), Position - 1 + New_Item'Length), + -- Length of the returned string + + Length (Overwrite'Result) = + Integer'Max (Length (Source), Position - 1 + New_Item'Length) + + -- Elements after Position are replaced by elements of New_Item + + and then + Slice (Overwrite'Result, 1, Position - 1) = + Slice (Source, 1, Position - 1) + and then + Slice (Overwrite'Result, Position, Position - 1 + New_Item'Length) = + New_Item + and then + (if Position - 1 + New_Item'Length < Length (Source) then + + -- There are some unchanged characters of Source remaining + -- after New_Item. + + Slice (Overwrite'Result, + Position + New_Item'Length, Length (Source)) = + Slice (Source, + Position + New_Item'Length, Length (Source))), Global => null; procedure Overwrite @@ -606,13 +1264,36 @@ is New_Item : String) with Pre => Position - 1 <= Length (Source) - and then (if New_Item'Length /= 0 - then - New_Item'Length <= Natural'Last - (Position - 1)), + and then New_Item'Length <= Natural'Last - (Position - 1), Post => - Length (Source) - = Natural'Max (Length (Source)'Old, Position - 1 + New_Item'Length), + -- Length of the returned string + + Length (Source) = + Integer'Max (Length (Source)'Old, Position - 1 + New_Item'Length) + + -- Elements after Position are replaced by elements of New_Item + + and then + Slice (Source, 1, Position - 1) = Slice (Source, 1, Position - 1) + and then + Slice (Source, Position, Position - 1 + New_Item'Length) = New_Item + and then + (if Position - 1 + New_Item'Length < Length (Source)'Old then + + -- There are some unchanged characters of Source remaining + -- after New_Item. + Slice (Source, + Position + New_Item'Length, Length (Source)'Old) = + Slice (Source, + -- Really "Position + New_Item'Length" but expressed with + -- a conditional repeating the above test so that the + -- call to Slice is valid on entry (under 'Old) even + -- when the test evaluates to False. + (if Position - 1 + New_Item'Length < Length (Source) + then Position + New_Item'Length + else 1), + Length (Source))'Old), Global => null; function Delete @@ -620,12 +1301,19 @@ is From : Positive; Through : Natural) return Unbounded_String with - Pre => (if Through <= From then From - 1 <= Length (Source)), + Pre => (if Through >= From then From - 1 <= Length (Source)), Contract_Cases => (Through >= From => - Length (Delete'Result) = Length (Source) - (Through - From + 1), + Length (Delete'Result) = + From - 1 + Natural'Max (Length (Source) - Through, 0) + and then + Slice (Delete'Result, 1, From - 1) = Slice (Source, 1, From - 1) + and then + (if Through < Length (Source) then + Slice (Delete'Result, From, Length (Delete'Result)) = + Slice (Source, Through + 1, Length (Source))), others => - Length (Delete'Result) = Length (Source)), + Delete'Result = Source), Global => null; procedure Delete @@ -633,82 +1321,255 @@ is From : Positive; Through : Natural) with - Pre => (if Through <= From then From - 1 <= Length (Source)), + Pre => (if Through >= From then From - 1 <= Length (Source)), Contract_Cases => (Through >= From => - Length (Source) = Length (Source)'Old - (Through - From + 1), + Length (Source) = + From - 1 + Natural'Max (Length (Source)'Old - Through, 0) + and then + Slice (Source, 1, From - 1) = + To_String (Source)'Old (1 .. From - 1) + and then + (if Through < Length (Source) then + Slice (Source, From, Length (Source)) = + To_String (Source)'Old (Through + 1 .. Length (Source)'Old)), others => - Length (Source) = Length (Source)'Old), + To_String (Source) = To_String (Source)'Old), Global => null; function Trim (Source : Unbounded_String; Side : Trim_End) return Unbounded_String with - Post => Length (Trim'Result) <= Length (Source), - Global => null; + Contract_Cases => + -- If all characters in Source are Space, the returned string is + -- empty. + + ((for all C of To_String (Source) => C = ' ') + => + Length (Trim'Result) = 0, + + -- Otherwise, the returned string is a slice of Source + + others + => + (declare + Low : constant Positive := + (if Side = Right then 1 + else Index_Non_Blank (Source, Forward)); + High : constant Positive := + (if Side = Left then Length (Source) + else Index_Non_Blank (Source, Backward)); + begin + To_String (Trim'Result) = Slice (Source, Low, High))), + Global => null; procedure Trim (Source : in out Unbounded_String; Side : Trim_End) with - Post => Length (Source) <= Length (Source)'Old, - Global => null; + Contract_Cases => + -- If all characters in Source are Space, the returned string is + -- empty. + + ((for all C of To_String (Source) => C = ' ') + => + Length (Source) = 0, + + -- Otherwise, the returned string is a slice of Source + + others + => + (declare + Low : constant Positive := + (if Side = Right then 1 + else Index_Non_Blank (Source, Forward)'Old); + High : constant Positive := + (if Side = Left then Length (Source)'Old + else Index_Non_Blank (Source, Backward)'Old); + begin + To_String (Source) = To_String (Source)'Old (Low .. High))), + Global => null; function Trim (Source : Unbounded_String; Left : Maps.Character_Set; Right : Maps.Character_Set) return Unbounded_String with - Post => Length (Trim'Result) <= Length (Source), - Global => null; + Contract_Cases => + -- If all characters in Source are contained in one of the sets Left + -- or Right, then the returned string is empty. + + ((for all C of To_String (Source) => Maps.Is_In (C, Left)) + or else + (for all C of To_String (Source) => Maps.Is_In (C, Right)) + => + Length (Trim'Result) = 0, + + -- Otherwise, the returned string is a slice of Source + + others + => + (declare + Low : constant Positive := + Index (Source, Left, Outside, Forward); + High : constant Positive := + Index (Source, Right, Outside, Backward); + begin + To_String (Trim'Result) = Slice (Source, Low, High))), + Global => null; procedure Trim (Source : in out Unbounded_String; Left : Maps.Character_Set; Right : Maps.Character_Set) with - Post => Length (Source) <= Length (Source)'Old, - Global => null; + Contract_Cases => + -- If all characters in Source are contained in one of the sets Left + -- or Right, then the returned string is empty. + + ((for all C of To_String (Source) => Maps.Is_In (C, Left)) + or else + (for all C of To_String (Source) => Maps.Is_In (C, Right)) + => + Length (Source) = 0, + + -- Otherwise, the returned string is a slice of Source + + others + => + (declare + Low : constant Positive := + Index (Source, Left, Outside, Forward)'Old; + High : constant Positive := + Index (Source, Right, Outside, Backward)'Old; + begin + To_String (Source) = To_String (Source)'Old (Low .. High))), + Global => null; function Head (Source : Unbounded_String; Count : Natural; Pad : Character := Space) return Unbounded_String with - Post => Length (Head'Result) = Count, - Global => null; + Post => Length (Head'Result) = Count, + Contract_Cases => + (Count <= Length (Source) + => + -- Source is cut + + To_String (Head'Result) = Slice (Source, 1, Count), + + others + => + -- Source is followed by Pad characters + + Slice (Head'Result, 1, Length (Source)) = To_String (Source) + and then + Slice (Head'Result, Length (Source) + 1, Count) = + [1 .. Count - Length (Source) => Pad]), + Global => null; procedure Head (Source : in out Unbounded_String; Count : Natural; Pad : Character := Space) with - Post => Length (Source) = Count, - Global => null; + Post => Length (Source) = Count, + Contract_Cases => + (Count <= Length (Source) + => + -- Source is cut + + To_String (Source) = Slice (Source, 1, Count), + + others + => + -- Source is followed by Pad characters + + Slice (Source, 1, Length (Source)'Old) = To_String (Source)'Old + and then + Slice (Source, Length (Source)'Old + 1, Count) = + [1 .. Count - Length (Source)'Old => Pad]), + Global => null; function Tail (Source : Unbounded_String; Count : Natural; Pad : Character := Space) return Unbounded_String with - Post => Length (Tail'Result) = Count, - Global => null; + Post => Length (Tail'Result) = Count, + Contract_Cases => + (Count = 0 + => + True, + + (Count in 1 .. Length (Source)) + => + -- Source is cut + + To_String (Tail'Result) = + Slice (Source, Length (Source) - Count + 1, Length (Source)), + + others + => + -- Source is preceded by Pad characters + + (if Length (Source) = 0 then + To_String (Tail'Result) = [1 .. Count => Pad] + else + Slice (Tail'Result, 1, Count - Length (Source)) = + [1 .. Count - Length (Source) => Pad] + and then + Slice (Tail'Result, Count - Length (Source) + 1, Count) = + To_String (Source))), + Global => null; procedure Tail (Source : in out Unbounded_String; Count : Natural; Pad : Character := Space) with - Post => Length (Source) = Count, - Global => null; + Post => Length (Source) = Count, + Contract_Cases => + (Count = 0 + => + True, + + (Count in 1 .. Length (Source)) + => + -- Source is cut + + To_String (Source) = + Slice (Source, + -- Really "Length (Source) - Count + 1" but expressed with a + -- conditional repeating the above guard so that the call to + -- Slice is valid on entry (under 'Old) even when the test + -- evaluates to False. + (if Count <= Length (Source) then Length (Source) - Count + 1 + else 1), + Length (Source))'Old, + + others + => + -- Source is preceded by Pad characters + + (if Length (Source)'Old = 0 then + To_String (Source) = [1 .. Count => Pad] + else + Slice (Source, 1, Count - Length (Source)'Old) = + [1 .. Count - Length (Source)'Old => Pad] + and then + Slice (Source, Count - Length (Source)'Old + 1, Count) = + To_String (Source)'Old)), + Global => null; function "*" (Left : Natural; Right : Character) return Unbounded_String with Pre => Left <= Natural'Last, - Post => Length ("*"'Result) = Left, + Post => To_String ("*"'Result) = [1 .. Left => Right], Global => null; function "*" @@ -716,7 +1577,13 @@ is Right : String) return Unbounded_String with Pre => (if Left /= 0 then Right'Length <= Natural'Last / Left), - Post => Length ("*"'Result) = Left * Right'Length, + Post => + Length ("*"'Result) = Left * Right'Length + and then + (if Right'Length > 0 then + (for all K in 1 .. Left * Right'Length => + Element ("*"'Result, K) = + Right (Right'First + (K - 1) mod Right'Length))), Global => null; function "*" @@ -724,7 +1591,13 @@ is Right : Unbounded_String) return Unbounded_String with Pre => (if Left /= 0 then Length (Right) <= Natural'Last / Left), - Post => Length ("*"'Result) = Left * Length (Right), + Post => + Length ("*"'Result) = Left * Length (Right) + and then + (if Length (Right) > 0 then + (for all K in 1 .. Left * Length (Right) => + Element ("*"'Result, K) = + Element (Right, 1 + (K - 1) mod Length (Right)))), Global => null; -- Each of the transformation functions (Replace_Slice, Insert, Overwrite, diff --git a/gcc/ada/libgnat/a-strunb__shared.adb b/gcc/ada/libgnat/a-strunb__shared.adb index ecc0e4af117..ef4f8c93bdb 100644 --- a/gcc/ada/libgnat/a-strunb__shared.adb +++ b/gcc/ada/libgnat/a-strunb__shared.adb @@ -29,7 +29,6 @@ -- -- ------------------------------------------------------------------------------ -with Ada.Strings.Search; with Ada.Unchecked_Deallocation; package body Ada.Strings.Unbounded is @@ -58,7 +57,7 @@ package body Ada.Strings.Unbounded is -- Calculation takes into account alignment of the allocated memory -- segments to use memory effectively by Append/Insert/etc operations. - function Sum (Left : Natural; Right : Integer) return Natural with Inline; + function Sum (Left, Right : Natural) return Natural with Inline; -- Returns summary of Left and Right, raise Constraint_Error on overflow function Mul (Left, Right : Natural) return Natural with Inline; @@ -165,7 +164,11 @@ package body Ada.Strings.Unbounded is else DR := Allocate (DL); DR.Data (1 .. Left'Length) := Left; - DR.Data (Left'Length + 1 .. DL) := RR.Data (1 .. RR.Last); + + if Left'Length < Natural'Last then + DR.Data (Left'Length + 1 .. DL) := RR.Data (1 .. RR.Last); + end if; + DR.Last := DL; end if; @@ -243,7 +246,7 @@ package body Ada.Strings.Unbounded is is DL : constant Natural := Mul (Left, Right'Length); DR : Shared_String_Access; - K : Positive; + K : Natural; begin -- Result is an empty string, reuse shared empty string @@ -255,10 +258,10 @@ package body Ada.Strings.Unbounded is else DR := Allocate (DL); - K := 1; + K := 0; for J in 1 .. Left loop - DR.Data (K .. K + Right'Length - 1) := Right; + DR.Data (K + 1 .. K + Right'Length) := Right; K := K + Right'Length; end loop; @@ -275,7 +278,7 @@ package body Ada.Strings.Unbounded is RR : constant Shared_String_Access := Right.Reference; DL : constant Natural := Mul (Left, RR.Last); DR : Shared_String_Access; - K : Positive; + K : Natural; begin -- Result is an empty string, reuse shared empty string @@ -293,10 +296,10 @@ package body Ada.Strings.Unbounded is else DR := Allocate (DL); - K := 1; + K := 0; for J in 1 .. Left loop - DR.Data (K .. K + RR.Last - 1) := RR.Data (1 .. RR.Last); + DR.Data (K + 1 .. K + RR.Last) := RR.Data (1 .. RR.Last); K := K + RR.Last; end loop; @@ -703,15 +706,15 @@ package body Ada.Strings.Unbounded is Reference (SR); DR := SR; - -- Index is out of range + -- From is too large - elsif Through > SR.Last then + elsif From - 1 > SR.Last then raise Index_Error; -- Compute size of the result else - DL := SR.Last - (Through - From + 1); + DL := SR.Last - (Natural'Min (SR.Last, Through) - From + 1); -- Result is an empty string, reuse shared empty string @@ -723,7 +726,11 @@ package body Ada.Strings.Unbounded is else DR := Allocate (DL); DR.Data (1 .. From - 1) := SR.Data (1 .. From - 1); - DR.Data (From .. DL) := SR.Data (Through + 1 .. SR.Last); + + if Through < Natural'Last then + DR.Data (From .. DL) := SR.Data (Through + 1 .. SR.Last); + end if; + DR.Last := DL; end if; end if; @@ -746,13 +753,13 @@ package body Ada.Strings.Unbounded is if From > Through then null; - -- Through is outside of the range + -- From is too large - elsif Through > SR.Last then + elsif From - 1 > SR.Last then raise Index_Error; else - DL := SR.Last - (Through - From + 1); + DL := SR.Last - (Natural'Min (SR.Last, Through) - From + 1); -- Result is empty, reuse shared empty string @@ -763,7 +770,10 @@ package body Ada.Strings.Unbounded is -- Try to reuse existing shared string elsif Can_Be_Reused (SR, DL) then - SR.Data (From .. DL) := SR.Data (Through + 1 .. SR.Last); + if Through < Natural'Last then + SR.Data (From .. DL) := SR.Data (Through + 1 .. SR.Last); + end if; + SR.Last := DL; -- Otherwise, allocate new shared string @@ -771,7 +781,11 @@ package body Ada.Strings.Unbounded is else DR := Allocate (DL); DR.Data (1 .. From - 1) := SR.Data (1 .. From - 1); - DR.Data (From .. DL) := SR.Data (Through + 1 .. SR.Last); + + if Through < Natural'Last then + DR.Data (From .. DL) := SR.Data (Through + 1 .. SR.Last); + end if; + DR.Last := DL; Source.Reference := DR; Unreference (SR); @@ -1093,7 +1107,7 @@ package body Ada.Strings.Unbounded is begin -- Check index first - if Before > SR.Last + 1 then + if Before - 1 > SR.Last then raise Index_Error; end if; @@ -1113,9 +1127,13 @@ package body Ada.Strings.Unbounded is else DR := Allocate (DL, DL / Growth_Factor); DR.Data (1 .. Before - 1) := SR.Data (1 .. Before - 1); - DR.Data (Before .. Before + New_Item'Length - 1) := New_Item; - DR.Data (Before + New_Item'Length .. DL) := - SR.Data (Before .. SR.Last); + DR.Data (Before .. Before - 1 + New_Item'Length) := New_Item; + + if Before <= SR.Last then + DR.Data (Before + New_Item'Length .. DL) := + SR.Data (Before .. SR.Last); + end if; + DR.Last := DL; end if; @@ -1134,7 +1152,7 @@ package body Ada.Strings.Unbounded is begin -- Check bounds - if Before > SR.Last + 1 then + if Before - 1 > SR.Last then raise Index_Error; end if; @@ -1152,9 +1170,12 @@ package body Ada.Strings.Unbounded is -- Try to reuse existing shared string first elsif Can_Be_Reused (SR, DL) then - SR.Data (Before + New_Item'Length .. DL) := - SR.Data (Before .. SR.Last); - SR.Data (Before .. Before + New_Item'Length - 1) := New_Item; + if Before <= SR.Last then + SR.Data (Before + New_Item'Length .. DL) := + SR.Data (Before .. SR.Last); + end if; + + SR.Data (Before .. Before - 1 + New_Item'Length) := New_Item; SR.Last := DL; -- Otherwise, allocate new shared string and fill it @@ -1162,9 +1183,13 @@ package body Ada.Strings.Unbounded is else DR := Allocate (DL, DL / Growth_Factor); DR.Data (1 .. Before - 1) := SR.Data (1 .. Before - 1); - DR.Data (Before .. Before + New_Item'Length - 1) := New_Item; - DR.Data (Before + New_Item'Length .. DL) := - SR.Data (Before .. SR.Last); + DR.Data (Before .. Before - 1 + New_Item'Length) := New_Item; + + if Before <= SR.Last then + DR.Data (Before + New_Item'Length .. DL) := + SR.Data (Before .. SR.Last); + end if; + DR.Last := DL; Source.Reference := DR; Unreference (SR); @@ -1206,7 +1231,7 @@ package body Ada.Strings.Unbounded is begin -- Check bounds - if Position > SR.Last + 1 then + if Position - 1 > SR.Last then raise Index_Error; end if; @@ -1228,9 +1253,13 @@ package body Ada.Strings.Unbounded is else DR := Allocate (DL); DR.Data (1 .. Position - 1) := SR.Data (1 .. Position - 1); - DR.Data (Position .. Position + New_Item'Length - 1) := New_Item; - DR.Data (Position + New_Item'Length .. DL) := - SR.Data (Position + New_Item'Length .. SR.Last); + DR.Data (Position .. Position - 1 + New_Item'Length) := New_Item; + + if Position <= SR.Last - New_Item'Length then + DR.Data (Position + New_Item'Length .. DL) := + SR.Data (Position + New_Item'Length .. SR.Last); + end if; + DR.Last := DL; end if; @@ -1249,11 +1278,11 @@ package body Ada.Strings.Unbounded is begin -- Bounds check - if Position > SR.Last + 1 then + if Position - 1 > SR.Last then raise Index_Error; end if; - DL := Integer'Max (SR.Last, Position + New_Item'Length - 1); + DL := Integer'Max (SR.Last, Sum (Position - 1, New_Item'Length)); -- Result is empty string, reuse empty shared string @@ -1269,7 +1298,7 @@ package body Ada.Strings.Unbounded is -- Try to reuse existing shared string elsif Can_Be_Reused (SR, DL) then - SR.Data (Position .. Position + New_Item'Length - 1) := New_Item; + SR.Data (Position .. Position - 1 + New_Item'Length) := New_Item; SR.Last := DL; -- Otherwise allocate new shared string and fill it @@ -1277,9 +1306,13 @@ package body Ada.Strings.Unbounded is else DR := Allocate (DL); DR.Data (1 .. Position - 1) := SR.Data (1 .. Position - 1); - DR.Data (Position .. Position + New_Item'Length - 1) := New_Item; - DR.Data (Position + New_Item'Length .. DL) := - SR.Data (Position + New_Item'Length .. SR.Last); + DR.Data (Position .. Position - 1 + New_Item'Length) := New_Item; + + if Position <= SR.Last - New_Item'Length then + DR.Data (Position + New_Item'Length .. DL) := + SR.Data (Position + New_Item'Length .. SR.Last); + end if; + DR.Last := DL; Source.Reference := DR; Unreference (SR); @@ -1365,15 +1398,14 @@ package body Ada.Strings.Unbounded is begin -- Check bounds - if Low > SR.Last + 1 then + if Low - 1 > SR.Last then raise Index_Error; end if; -- Do replace operation when removed slice is not empty if High >= Low then - DL := Sum (SR.Last, - By'Length + Low - Integer'Min (High, SR.Last) - 1); + DL := Sum (Low - 1 + Integer'Max (SR.Last - High, 0), By'Length); -- This is the number of characters remaining in the string after -- replacing the slice. @@ -1387,8 +1419,13 @@ package body Ada.Strings.Unbounded is else DR := Allocate (DL); DR.Data (1 .. Low - 1) := SR.Data (1 .. Low - 1); - DR.Data (Low .. Low + By'Length - 1) := By; - DR.Data (Low + By'Length .. DL) := SR.Data (High + 1 .. SR.Last); + DR.Data (Low .. Low - 1 + By'Length) := By; + + if High < SR.Last then + DR.Data (Low + By'Length .. DL) := + SR.Data (High + 1 .. SR.Last); + end if; + DR.Last := DL; end if; @@ -1414,14 +1451,14 @@ package body Ada.Strings.Unbounded is begin -- Bounds check - if Low > SR.Last + 1 then + if Low - 1 > SR.Last then raise Index_Error; end if; -- Do replace operation only when replaced slice is not empty if High >= Low then - DL := By'Length + SR.Last + Low - Integer'Min (High, SR.Last) - 1; + DL := Sum (Low - 1 + Integer'Max (SR.Last - High, 0), By'Length); -- This is the number of characters remaining in the string after -- replacing the slice. @@ -1434,8 +1471,12 @@ package body Ada.Strings.Unbounded is -- Try to reuse existing shared string elsif Can_Be_Reused (SR, DL) then - SR.Data (Low + By'Length .. DL) := SR.Data (High + 1 .. SR.Last); - SR.Data (Low .. Low + By'Length - 1) := By; + if High < SR.Last then + SR.Data (Low + By'Length .. DL) := + SR.Data (High + 1 .. SR.Last); + end if; + + SR.Data (Low .. Low - 1 + By'Length) := By; SR.Last := DL; -- Otherwise allocate new shared string and fill it @@ -1443,8 +1484,13 @@ package body Ada.Strings.Unbounded is else DR := Allocate (DL); DR.Data (1 .. Low - 1) := SR.Data (1 .. Low - 1); - DR.Data (Low .. Low + By'Length - 1) := By; - DR.Data (Low + By'Length .. DL) := SR.Data (High + 1 .. SR.Last); + DR.Data (Low .. Low - 1 + By'Length) := By; + + if High < SR.Last then + DR.Data (Low + By'Length .. DL) := + SR.Data (High + 1 .. SR.Last); + end if; + DR.Last := DL; Source.Reference := DR; Unreference (SR); @@ -1509,7 +1555,7 @@ package body Ada.Strings.Unbounded is begin -- Note: test of High > Length is in accordance with AI95-00128 - if Low > SR.Last + 1 or else High > SR.Last then + if Low - 1 > SR.Last or else High > SR.Last then raise Index_Error; else @@ -1521,7 +1567,7 @@ package body Ada.Strings.Unbounded is -- Sum -- --------- - function Sum (Left : Natural; Right : Integer) return Natural is + function Sum (Left, Right : Natural) return Natural is pragma Unsuppress (Overflow_Check); begin return Left + Right; diff --git a/gcc/ada/libgnat/a-strunb__shared.ads b/gcc/ada/libgnat/a-strunb__shared.ads index 3a0411de5de..fa97680a7fa 100644 --- a/gcc/ada/libgnat/a-strunb__shared.ads +++ b/gcc/ada/libgnat/a-strunb__shared.ads @@ -35,9 +35,14 @@ -- Preconditions in this unit are meant for analysis only, not for run-time -- checking, so that the expected exceptions are raised. This is enforced by --- setting the corresponding assertion policy to Ignore. +-- setting the corresponding assertion policy to Ignore. Postconditions and +-- contract cases should not be executed at runtime as well, in order not to +-- slow down the execution of these functions. -pragma Assertion_Policy (Pre => Ignore); +pragma Assertion_Policy (Pre => Ignore, + Post => Ignore, + Contract_Cases => Ignore, + Ghost => Ignore); -- This package provides an implementation of Ada.Strings.Unbounded that uses -- reference counts to implement copy on modification (rather than copy on @@ -77,17 +82,26 @@ pragma Assertion_Policy (Pre => Ignore); -- make objects of Unbounded_String thread-safe: an instance cannot be -- accessed by several tasks simultaneously. -with Ada.Strings.Maps; +with Ada.Strings.Maps; use type Ada.Strings.Maps.Character_Mapping_Function; private with Ada.Finalization; private with System.Atomic_Counters; +with Ada.Strings.Search; private with Ada.Strings.Text_Buffers; package Ada.Strings.Unbounded with + SPARK_Mode, Initial_Condition => Length (Null_Unbounded_String) = 0, Always_Terminates is pragma Preelaborate; + -- Contracts may call function Length in the prefix of attribute reference + -- to Old as in Length (Source)'Old. Allow this use. + + pragma Unevaluated_Use_Of_Old (Allow); + + subtype String_1 is String (1 .. <>) with Ghost; -- Type used in contracts + type Unbounded_String is private with Default_Initial_Condition => Length (Unbounded_String) = 0; pragma Preelaborable_Initialization (Unbounded_String); @@ -99,7 +113,7 @@ is type String_Access is access all String; - procedure Free (X : in out String_Access); + procedure Free (X : in out String_Access) with SPARK_Mode => Off; -------------------------------------------------------- -- Conversion, Concatenation, and Selection Functions -- @@ -108,7 +122,8 @@ is function To_Unbounded_String (Source : String) return Unbounded_String with - Post => To_String (To_Unbounded_String'Result) = Source, + Post => To_String (To_Unbounded_String'Result) = Source + and then Length (To_Unbounded_String'Result) = Source'Length, Global => null; function To_Unbounded_String @@ -136,7 +151,8 @@ is New_Item : Unbounded_String) with Pre => Length (New_Item) <= Natural'Last - Length (Source), - Post => Length (Source) = Length (Source)'Old + Length (New_Item), + Post => + To_String (Source) = To_String (Source)'Old & To_String (New_Item), Global => null; procedure Append @@ -144,7 +160,7 @@ is New_Item : String) with Pre => New_Item'Length <= Natural'Last - Length (Source), - Post => Length (Source) = Length (Source)'Old + New_Item'Length, + Post => To_String (Source) = To_String (Source)'Old & New_Item, Global => null; procedure Append @@ -152,7 +168,7 @@ is New_Item : Character) with Pre => Length (Source) < Natural'Last, - Post => Length (Source) = Length (Source)'Old + 1, + Post => To_String (Source) = To_String (Source)'Old & New_Item, Global => null; function "&" @@ -160,7 +176,7 @@ is Right : Unbounded_String) return Unbounded_String with Pre => Length (Right) <= Natural'Last - Length (Left), - Post => Length ("&"'Result) = Length (Left) + Length (Right), + Post => To_String ("&"'Result) = To_String (Left) & To_String (Right), Global => null; function "&" @@ -168,7 +184,7 @@ is Right : String) return Unbounded_String with Pre => Right'Length <= Natural'Last - Length (Left), - Post => Length ("&"'Result) = Length (Left) + Right'Length, + Post => To_String ("&"'Result) = To_String (Left) & Right, Global => null; function "&" @@ -176,7 +192,7 @@ is Right : Unbounded_String) return Unbounded_String with Pre => Left'Length <= Natural'Last - Length (Right), - Post => Length ("&"'Result) = Left'Length + Length (Right), + Post => To_String ("&"'Result) = String_1 (Left) & To_String (Right), Global => null; function "&" @@ -184,7 +200,7 @@ is Right : Character) return Unbounded_String with Pre => Length (Left) < Natural'Last, - Post => Length ("&"'Result) = Length (Left) + 1, + Post => To_String ("&"'Result) = To_String (Left) & Right, Global => null; function "&" @@ -192,7 +208,7 @@ is Right : Unbounded_String) return Unbounded_String with Pre => Length (Right) < Natural'Last, - Post => Length ("&"'Result) = Length (Right) + 1, + Post => To_String ("&"'Result) = Left & To_String (Right), Global => null; function Element @@ -209,7 +225,8 @@ is By : Character) with Pre => Index <= Length (Source), - Post => Length (Source) = Length (Source)'Old, + Post => + To_String (Source) = (To_String (Source)'Old with delta Index => By), Global => null; function Slice @@ -218,7 +235,9 @@ is High : Natural) return String with Pre => Low - 1 <= Length (Source) and then High <= Length (Source), - Post => Slice'Result'Length = Natural'Max (0, High - Low + 1), + Post => Slice'Result'First = Low + and then Slice'Result'Last = High + and then Slice'Result = To_String (Source) (Low .. High), Global => null; function Unbounded_Slice @@ -228,7 +247,7 @@ is with Pre => Low - 1 <= Length (Source) and then High <= Length (Source), Post => - Length (Unbounded_Slice'Result) = Natural'Max (0, High - Low + 1), + To_String (Unbounded_Slice'Result) = To_String (Source) (Low .. High), Global => null; pragma Ada_05 (Unbounded_Slice); @@ -239,7 +258,7 @@ is High : Natural) with Pre => Low - 1 <= Length (Source) and then High <= Length (Source), - Post => Length (Target) = Natural'Max (0, High - Low + 1), + Post => To_String (Target) = To_String (Source) (Low .. High), Global => null; pragma Ada_05 (Unbounded_Slice); @@ -268,72 +287,84 @@ is (Left : Unbounded_String; Right : Unbounded_String) return Boolean with + Post => "<"'Result = (To_String (Left) < To_String (Right)), Global => null; function "<" (Left : Unbounded_String; Right : String) return Boolean with + Post => "<"'Result = (To_String (Left) < Right), Global => null; function "<" (Left : String; Right : Unbounded_String) return Boolean with + Post => "<"'Result = (Left < To_String (Right)), Global => null; function "<=" (Left : Unbounded_String; Right : Unbounded_String) return Boolean with + Post => "<="'Result = (To_String (Left) <= To_String (Right)), Global => null; function "<=" (Left : Unbounded_String; Right : String) return Boolean with + Post => "<="'Result = (To_String (Left) <= Right), Global => null; function "<=" (Left : String; Right : Unbounded_String) return Boolean with + Post => "<="'Result = (Left <= To_String (Right)), Global => null; function ">" (Left : Unbounded_String; Right : Unbounded_String) return Boolean with + Post => ">"'Result = (To_String (Left) > To_String (Right)), Global => null; function ">" (Left : Unbounded_String; Right : String) return Boolean with + Post => ">"'Result = (To_String (Left) > Right), Global => null; function ">" (Left : String; Right : Unbounded_String) return Boolean with + Post => ">"'Result = (Left > To_String (Right)), Global => null; function ">=" (Left : Unbounded_String; Right : Unbounded_String) return Boolean with + Post => ">="'Result = (To_String (Left) >= To_String (Right)), Global => null; function ">=" (Left : Unbounded_String; Right : String) return Boolean with + Post => ">="'Result = (To_String (Left) >= Right), Global => null; function ">=" (Left : String; Right : Unbounded_String) return Boolean with + Post => ">="'Result = (Left >= To_String (Right)), Global => null; ------------------------ @@ -346,8 +377,52 @@ is Going : Direction := Forward; Mapping : Maps.Character_Mapping := Maps.Identity) return Natural with - Pre => Pattern'Length /= 0, - Global => null; + Pre => Pattern'Length > 0, + Post => Index'Result <= Length (Source), + Contract_Cases => + + -- If Source is the empty string, then 0 is returned + + (Length (Source) = 0 + => + Index'Result = 0, + + -- If some slice of Source matches Pattern, then a valid index is + -- returned. + + Length (Source) > 0 + and then + (for some J in 1 .. Length (Source) - (Pattern'Length - 1) => + Search.Match (To_String (Source), Pattern, Mapping, J)) + => + -- The result is in the considered range of Source + + Index'Result in 1 .. Length (Source) - (Pattern'Length - 1) + + -- The slice beginning at the returned index matches Pattern + + and then Search.Match + (To_String (Source), Pattern, Mapping, Index'Result) + + -- The result is the smallest or largest index which satisfies + -- the matching, respectively when Going = Forward and Going = + -- Backward. + + and then + (for all J in 1 .. Length (Source) => + (if (if Going = Forward + then J <= Index'Result - 1 + else J - 1 in Index'Result + .. Length (Source) - Pattern'Length) + then not (Search.Match + (To_String (Source), Pattern, Mapping, J)))), + + -- Otherwise, 0 is returned + + others + => + Index'Result = 0), + Global => null; function Index (Source : Unbounded_String; @@ -355,8 +430,52 @@ is Going : Direction := Forward; Mapping : Maps.Character_Mapping_Function) return Natural with - Pre => Pattern'Length /= 0, - Global => null; + Pre => Pattern'Length /= 0 and then Mapping /= null, + Post => Index'Result <= Length (Source), + Contract_Cases => + + -- If Source is the empty string, then 0 is returned + + (Length (Source) = 0 + => + Index'Result = 0, + + -- If some slice of Source matches Pattern, then a valid index is + -- returned. + + Length (Source) > 0 + and then + (for some J in 1 .. Length (Source) - (Pattern'Length - 1) => + Search.Match (To_String (Source), Pattern, Mapping, J)) + => + -- The result is in the considered range of Source + + Index'Result in 1 .. Length (Source) - (Pattern'Length - 1) + + -- The slice beginning at the returned index matches Pattern + + and then Search.Match + (To_String (Source), Pattern, Mapping, Index'Result) + + -- The result is the smallest or largest index which satisfies + -- the matching, respectively when Going = Forward and Going = + -- Backward. + + and then + (for all J in 1 .. Length (Source) => + (if (if Going = Forward + then J <= Index'Result - 1 + else J - 1 in Index'Result + .. Length (Source) - Pattern'Length) + then not (Search.Match + (To_String (Source), Pattern, Mapping, J)))), + + -- Otherwise, 0 is returned + + others + => + Index'Result = 0), + Global => null; function Index (Source : Unbounded_String; @@ -364,7 +483,43 @@ is Test : Membership := Inside; Going : Direction := Forward) return Natural with - Global => null; + Post => Index'Result <= Length (Source), + Contract_Cases => + + -- If no character of Source satisfies the property Test on Set, + -- then 0 is returned. + + ((for all C of To_String (Source) => + (Test = Inside) /= Maps.Is_In (C, Set)) + => + Index'Result = 0, + + -- Otherwise, an index in the range of Source is returned + + others + => + -- The result is in the range of Source + + Index'Result in 1 .. Length (Source) + + -- The character at the returned index satisfies the property + -- Test on Set. + + and then + (Test = Inside) = + Maps.Is_In (Element (Source, Index'Result), Set) + + -- The result is the smallest or largest index which satisfies + -- the property, respectively when Going = Forward and Going = + -- Backward. + + and then + (for all J in 1 .. Length (Source) => + (if J /= Index'Result + and then (J < Index'Result) = (Going = Forward) + then (Test = Inside) + /= Maps.Is_In (Element (Source, J), Set)))), + Global => null; function Index (Source : Unbounded_String; @@ -373,9 +528,60 @@ is Going : Direction := Forward; Mapping : Maps.Character_Mapping := Maps.Identity) return Natural with - Pre => (if Length (Source) /= 0 then From <= Length (Source)) - and then Pattern'Length /= 0, - Global => null; + Pre => + (if Length (Source) /= 0 then From <= Length (Source)) + and then Pattern'Length /= 0, + Post => Index'Result <= Length (Source), + Contract_Cases => + + -- If Source is the empty string, then 0 is returned + + (Length (Source) = 0 + => + Index'Result = 0, + + -- If some slice of Source matches Pattern, then a valid index is + -- returned. + + Length (Source) > 0 + and then + (for some J in + (if Going = Forward then From else 1) + .. (if Going = Forward then Length (Source) else From) + - (Pattern'Length - 1) => + Search.Match (To_String (Source), Pattern, Mapping, J)) + => + -- The result is in the considered range of Source + + Index'Result in + (if Going = Forward then From else 1) + .. (if Going = Forward then Length (Source) else From) + - (Pattern'Length - 1) + + -- The slice beginning at the returned index matches Pattern + + and then Search.Match + (To_String (Source), Pattern, Mapping, Index'Result) + + -- The result is the smallest or largest index which satisfies + -- the matching, respectively when Going = Forward and Going = + -- Backward. + + and then + (for all J in 1 .. Length (Source) => + (if (if Going = Forward + then J in From .. Index'Result - 1 + else J - 1 in Index'Result + .. From - Pattern'Length) + then not (Search.Match + (To_String (Source), Pattern, Mapping, J)))), + + -- Otherwise, 0 is returned + + others + => + Index'Result = 0), + Global => null; pragma Ada_05 (Index); function Index @@ -385,9 +591,61 @@ is Going : Direction := Forward; Mapping : Maps.Character_Mapping_Function) return Natural with - Pre => (if Length (Source) /= 0 then From <= Length (Source)) - and then Pattern'Length /= 0, - Global => null; + Pre => + (if Length (Source) /= 0 then From <= Length (Source)) + and then Pattern'Length /= 0 + and then Mapping /= null, + Post => Index'Result <= Length (Source), + Contract_Cases => + + -- If Source is the empty string, then 0 is returned + + (Length (Source) = 0 + => + Index'Result = 0, + + -- If some slice of Source matches Pattern, then a valid index is + -- returned. + + Length (Source) > 0 + and then + (for some J in + (if Going = Forward then From else 1) + .. (if Going = Forward then Length (Source) else From) + - (Pattern'Length - 1) => + Search.Match (To_String (Source), Pattern, Mapping, J)) + => + -- The result is in the considered range of Source + + Index'Result in + (if Going = Forward then From else 1) + .. (if Going = Forward then Length (Source) else From) + - (Pattern'Length - 1) + + -- The slice beginning at the returned index matches Pattern + + and then Search.Match + (To_String (Source), Pattern, Mapping, Index'Result) + + -- The result is the smallest or largest index which satisfies + -- the matching, respectively when Going = Forward and Going = + -- Backward. + + and then + (for all J in 1 .. Length (Source) => + (if (if Going = Forward + then J in From .. Index'Result - 1 + else J - 1 in Index'Result + .. From - Pattern'Length) + then not (Search.Match + (To_String (Source), Pattern, Mapping, J)))), + + -- Otherwise, 0 is returned + + others + => + Index'Result = 0), + Global => null; pragma Ada_05 (Index); function Index @@ -397,23 +655,147 @@ is Test : Membership := Inside; Going : Direction := Forward) return Natural with - Pre => (if Length (Source) /= 0 then From <= Length (Source)), - Global => null; + Pre => + (if Length (Source) /= 0 then From <= Length (Source)), + Post => Index'Result <= Length (Source), + Contract_Cases => + + -- If Source is the empty string, or no character of the considered + -- slice of Source satisfies the property Test on Set, then 0 is + -- returned. + + (Length (Source) = 0 + or else + (for all J in 1 .. Length (Source) => + (if J = From or else (J > From) = (Going = Forward) then + (Test = Inside) /= Maps.Is_In (Element (Source, J), Set))) + => + Index'Result = 0, + + -- Otherwise, an index in the considered range of Source is + -- returned. + + others + => + -- The result is in the considered range of Source + + Index'Result in 1 .. Length (Source) + and then + (Index'Result = From + or else (Index'Result > From) = (Going = Forward)) + + -- The character at the returned index satisfies the property + -- Test on Set. + + and then + (Test = Inside) = + Maps.Is_In (Element (Source, Index'Result), Set) + + -- The result is the smallest or largest index which satisfies + -- the property, respectively when Going = Forward and Going = + -- Backward. + + and then + (for all J in 1 .. Length (Source) => + (if J /= Index'Result + and then (J < Index'Result) = (Going = Forward) + and then (J = From + or else (J > From) = (Going = Forward)) + then (Test = Inside) + /= Maps.Is_In (Element (Source, J), Set)))), + Global => null; pragma Ada_05 (Index); function Index_Non_Blank (Source : Unbounded_String; Going : Direction := Forward) return Natural with - Global => null; + Post => Index_Non_Blank'Result <= Length (Source), + Contract_Cases => + + -- If all characters of Source are Space characters, then 0 is + -- returned. + + ((for all C of To_String (Source) => C = ' ') + => + Index_Non_Blank'Result = 0, + + -- Otherwise, an index in the range of Source is returned + + others + => + -- The result is in the range of Source + + Index_Non_Blank'Result in 1 .. Length (Source) + + -- The character at the returned index is not a Space character + + and then Element (Source, Index_Non_Blank'Result) /= ' ' + + -- The result is the smallest or largest index which is not a + -- Space character, respectively when Going = Forward and Going + -- = Backward. + + and then + (for all J in 1 .. Length (Source) => + (if J /= Index_Non_Blank'Result + and then + (J < Index_Non_Blank'Result) = (Going = Forward) + then Element (Source, J) = ' '))), + Global => null; function Index_Non_Blank (Source : Unbounded_String; From : Positive; Going : Direction := Forward) return Natural with - Pre => (if Length (Source) /= 0 then From <= Length (Source)), - Global => null; + Pre => + (if Length (Source) /= 0 then From <= Length (Source)), + Post => Index_Non_Blank'Result <= Length (Source), + Contract_Cases => + + -- If Source is the empty string, or all characters of the + -- considered slice of Source are Space characters, then 0 + -- is returned. + + (Length (Source) = 0 + or else + (for all J in 1 .. Length (Source) => + (if J = From or else (J > From) = (Going = Forward) then + Element (Source, J) = ' ')) + => + Index_Non_Blank'Result = 0, + + -- Otherwise, an index in the considered range of Source is + -- returned. + + others + => + -- The result is in the considered range of Source + + Index_Non_Blank'Result in 1 .. Length (Source) + and then + (Index_Non_Blank'Result = From + or else + (Index_Non_Blank'Result > From) = (Going = Forward)) + + -- The character at the returned index is not a Space character + + and then Element (Source, Index_Non_Blank'Result) /= ' ' + + -- The result is the smallest or largest index which isn't a + -- Space character, respectively when Going = Forward and Going + -- = Backward. + + and then + (for all J in 1 .. Length (Source) => + (if J /= Index_Non_Blank'Result + and then + (J < Index_Non_Blank'Result) = (Going = Forward) + and then (J = From + or else (J > From) = (Going = Forward)) + then Element (Source, J) = ' '))), + Global => null; pragma Ada_05 (Index_Non_Blank); function Count @@ -429,7 +811,7 @@ is Pattern : String; Mapping : Maps.Character_Mapping_Function) return Natural with - Pre => Pattern'Length /= 0, + Pre => Pattern'Length /= 0 and then Mapping /= null, Global => null; function Count @@ -446,8 +828,53 @@ is First : out Positive; Last : out Natural) with - Pre => (if Length (Source) /= 0 then From <= Length (Source)), - Global => null; + Pre => + (if Length (Source) /= 0 then From <= Length (Source)), + Contract_Cases => + + -- If Source is the empty string, or if no character of the + -- considered slice of Source satisfies the property Test on + -- Set, then First is set to From and Last is set to 0. + + (Length (Source) = 0 + or else + (for all J in From .. Length (Source) => + (Test = Inside) /= Maps.Is_In (Element (Source, J), Set)) + => + First = From and then Last = 0, + + -- Otherwise, First and Last are set to valid indexes + + others + => + -- First and Last are in the considered range of Source + + First in From .. Length (Source) + and then Last in First .. Length (Source) + + -- No character between From and First satisfies the property + -- Test on Set. + + and then + (for all J in From .. First - 1 => + (Test = Inside) /= Maps.Is_In (Element (Source, J), Set)) + + -- All characters between First and Last satisfy the property + -- Test on Set. + + and then + (for all J in First .. Last => + (Test = Inside) = Maps.Is_In (Element (Source, J), Set)) + + -- If Last is not Source'Last, then the character at position + -- Last + 1 does not satify the property Test on Set. + + and then + (if Last < Length (Source) + then + (Test = Inside) + /= Maps.Is_In (Element (Source, Last + 1), Set))), + Global => null; pragma Ada_2012 (Find_Token); procedure Find_Token @@ -457,7 +884,51 @@ is First : out Positive; Last : out Natural) with - Global => null; + Contract_Cases => + + -- If Source is the empty string, or if no character of the + -- considered slice of Source satisfies the property Test on + -- Set, then First is set to 1 and Last is set to 0. + + (Length (Source) = 0 + or else + (for all J in 1 .. Length (Source) => + (Test = Inside) /= Maps.Is_In (Element (Source, J), Set)) + => + First = 1 and then Last = 0, + + -- Otherwise, First and Last are set to valid indexes + + others + => + -- First and Last are in the considered range of Source + + First in 1 .. Length (Source) + and then Last in First .. Length (Source) + + -- No character between 1 and First satisfies the property Test + -- on Set. + + and then + (for all J in 1 .. First - 1 => + (Test = Inside) /= Maps.Is_In (Element (Source, J), Set)) + + -- All characters between First and Last satisfy the property + -- Test on Set. + + and then + (for all J in First .. Last => + (Test = Inside) = Maps.Is_In (Element (Source, J), Set)) + + -- If Last is not Source'Last, then the character at position + -- Last + 1 does not satify the property Test on Set. + + and then + (if Last < Length (Source) + then + (Test = Inside) + /= Maps.Is_In (Element (Source, Last + 1), Set))), + Global => null; ------------------------------------ -- String Translation Subprograms -- @@ -467,28 +938,44 @@ is (Source : Unbounded_String; Mapping : Maps.Character_Mapping) return Unbounded_String with - Post => Length (Translate'Result) = Length (Source), + Post => Length (Translate'Result) = Length (Source) + and then + (for all K in 1 .. Length (Source) => + Element (Translate'Result, K) = + Ada.Strings.Maps.Value (Mapping, Element (Source, K))), Global => null; procedure Translate (Source : in out Unbounded_String; Mapping : Maps.Character_Mapping) with - Post => Length (Source) = Length (Source)'Old, + Post => Length (Source) = Length (Source)'Old + and then + (for all K in 1 .. Length (Source) => + Element (Source, K) = + Ada.Strings.Maps.Value (Mapping, To_String (Source)'Old (K))), Global => null; function Translate (Source : Unbounded_String; Mapping : Maps.Character_Mapping_Function) return Unbounded_String with - Post => Length (Translate'Result) = Length (Source), + Pre => Mapping /= null, + Post => Length (Translate'Result) = Length (Source) + and then + (for all K in 1 .. Length (Source) => + Element (Translate'Result, K) = Mapping (Element (Source, K))), Global => null; procedure Translate (Source : in out Unbounded_String; Mapping : Maps.Character_Mapping_Function) with - Post => Length (Source) = Length (Source)'Old, + Pre => Mapping /= null, + Post => Length (Source) = Length (Source)'Old + and then + (for all K in 1 .. Length (Source) => + Element (Source, K) = Mapping (To_String (Source)'Old (K))), Global => null; --------------------------------------- @@ -506,14 +993,66 @@ is and then (if High >= Low then Low - 1 <= Natural'Last - By'Length - - Natural'Max (Length (Source) - High, 0) + - Integer'Max (Length (Source) - High, 0) else Length (Source) <= Natural'Last - By'Length), Contract_Cases => + + -- If High >= Low, when considering the application of To_String to + -- convert an Unbounded_String into String, then the returned string + -- comprises Source (Source'First .. Low - 1) & By + -- & Source(High + 1 .. Source'Last). + (High >= Low => + + -- Length of the returned string + Length (Replace_Slice'Result) - = Low - 1 + By'Length + Natural'Max (Length (Source)'Old - High, 0), + = Low - 1 + By'Length + Integer'Max (Length (Source) - High, 0) + + -- Elements starting at Low are replaced by elements of By + + and then + Slice (Replace_Slice'Result, 1, Low - 1) = + Slice (Source, 1, Low - 1) + and then + Slice (Replace_Slice'Result, Low, Low - 1 + By'Length) = By + + -- When there are remaining characters after the replaced slice, + -- they are appended to the result. + + and then + (if High < Length (Source) + then + Slice (Replace_Slice'Result, + Low + By'Length, Length (Replace_Slice'Result)) = + Slice (Source, High + 1, Length (Source))), + + -- If High < Low, then the returned string is + -- Insert (Source, Before => Low, New_Item => By). + others => - Length (Replace_Slice'Result) = Length (Source)'Old + By'Length), + + -- Length of the returned string + + Length (Replace_Slice'Result) = Length (Source) + By'Length + + -- Elements of By are inserted after the element at Low + + and then + Slice (Replace_Slice'Result, 1, Low - 1) = + Slice (Source, 1, Low - 1) + and then + Slice (Replace_Slice'Result, Low, Low - 1 + By'Length) = By + + -- When there are remaining characters after Low in Source, they + -- are appended to the result. + + and then + (if Low < Length (Source) + then + Slice (Replace_Slice'Result, + Low + By'Length, Length (Replace_Slice'Result)) = + Slice (Source, Low, Length (Source)))), Global => null; procedure Replace_Slice @@ -530,11 +1069,61 @@ is - Natural'Max (Length (Source) - High, 0) else Length (Source) <= Natural'Last - By'Length), Contract_Cases => + + -- If High >= Low, when considering the application of To_String to + -- convert an Unbounded_String into String, then the returned string + -- comprises Source (Source'First .. Low - 1) & By + -- & Source(High + 1 .. Source'Last). + (High >= Low => + + -- Length of the returned string + Length (Source) - = Low - 1 + By'Length + Natural'Max (Length (Source)'Old - High, 0), + = Low - 1 + By'Length + Integer'Max (Length (Source)'Old - High, 0) + + -- Elements starting at Low are replaced by elements of By + + and then Slice (Source, 1, Low - 1) = + Slice (Source, 1, Low - 1)'Old + and then Slice (Source, Low, Low - 1 + By'Length) = By + + -- When there are remaining characters after the replaced slice, + -- they are appended to the result. + + and then + (if High < Length (Source)'Old + then Slice (Source, Low + By'Length, Length (Source)) = + Slice (Source, + -- Really "High + 1" but expressed with a conditional + -- repeating the above test so that the call to Slice + -- is valid on entry (under 'Old) even when the test + -- evaluates to False. + (if High < Length (Source) then High + 1 else 1), + Length (Source))'Old), + + -- If High < Low, then the returned string is + -- Insert (Source, Before => Low, New_Item => By). + others => - Length (Source) = Length (Source)'Old + By'Length), + + -- Length of the returned string + + Length (Source) = Length (Source)'Old + By'Length + + -- Elements of By are inserted after the element at Low + + and then Slice (Source, 1, Low - 1) = + Slice (Source, 1, Low - 1)'Old + and then Slice (Source, Low, Low - 1 + By'Length) = By + + -- When there are remaining characters after Low in Source, they + -- are appended to the result. + + and then + (if Low < Length (Source)'Old + then Slice (Source, Low + By'Length, Length (Source)) = + Slice (Source, Low, Length (Source))'Old)), Global => null; function Insert @@ -544,7 +1133,27 @@ is with Pre => Before - 1 <= Length (Source) and then New_Item'Length <= Natural'Last - Length (Source), - Post => Length (Insert'Result) = Length (Source) + New_Item'Length, + Post => + -- Length of the returned string + + Length (Insert'Result) = Length (Source) + New_Item'Length + + -- Elements of New_Item are inserted after element at Before + + and then + Slice (Insert'Result, 1, Before - 1) = Slice (Source, 1, Before - 1) + and then + Slice (Insert'Result, Before, Before - 1 + New_Item'Length) + = New_Item + + -- When there are remaining characters after Before in Source, they + -- are appended to the returned string. + + and then + (if Before <= Length (Source) then + Slice (Insert'Result, Before + New_Item'Length, + Length (Insert'Result)) = + Slice (Source, Before, Length (Source))), Global => null; procedure Insert @@ -554,7 +1163,25 @@ is with Pre => Before - 1 <= Length (Source) and then New_Item'Length <= Natural'Last - Length (Source), - Post => Length (Source) = Length (Source)'Old + New_Item'Length, + Post => + -- Length of the returned string + + Length (Source) = Length (Source)'Old + New_Item'Length + + -- Elements of New_Item are inserted after element at Before + + and then + Slice (Source, 1, Before - 1) = Slice (Source, 1, Before - 1)'Old + and then + Slice (Source, Before, Before - 1 + New_Item'Length) = New_Item + + -- When there are remaining characters after Before in Source, they + -- are appended to the returned string. + + and then + (if Before <= Length (Source)'Old then + Slice (Source, Before + New_Item'Length, Length (Source)) = + Slice (Source, Before, Length (Source))'Old), Global => null; function Overwrite @@ -563,12 +1190,31 @@ is New_Item : String) return Unbounded_String with Pre => Position - 1 <= Length (Source) - and then (if New_Item'Length /= 0 - then - New_Item'Length <= Natural'Last - (Position - 1)), + and then New_Item'Length <= Natural'Last - (Position - 1), Post => - Length (Overwrite'Result) - = Natural'Max (Length (Source), Position - 1 + New_Item'Length), + -- Length of the returned string + + Length (Overwrite'Result) = + Integer'Max (Length (Source), Position - 1 + New_Item'Length) + + -- Elements after Position are replaced by elements of New_Item + + and then + Slice (Overwrite'Result, 1, Position - 1) = + Slice (Source, 1, Position - 1) + and then + Slice (Overwrite'Result, Position, Position - 1 + New_Item'Length) = + New_Item + and then + (if Position - 1 + New_Item'Length < Length (Source) then + + -- There are some unchanged characters of Source remaining + -- after New_Item. + + Slice (Overwrite'Result, + Position + New_Item'Length, Length (Source)) = + Slice (Source, + Position + New_Item'Length, Length (Source))), Global => null; procedure Overwrite @@ -577,13 +1223,36 @@ is New_Item : String) with Pre => Position - 1 <= Length (Source) - and then (if New_Item'Length /= 0 - then - New_Item'Length <= Natural'Last - (Position - 1)), + and then New_Item'Length <= Natural'Last - (Position - 1), Post => - Length (Source) - = Natural'Max (Length (Source)'Old, Position - 1 + New_Item'Length), + -- Length of the returned string + + Length (Source) = + Integer'Max (Length (Source)'Old, Position - 1 + New_Item'Length) + + -- Elements after Position are replaced by elements of New_Item + and then + Slice (Source, 1, Position - 1) = Slice (Source, 1, Position - 1) + and then + Slice (Source, Position, Position - 1 + New_Item'Length) = New_Item + and then + (if Position - 1 + New_Item'Length < Length (Source)'Old then + + -- There are some unchanged characters of Source remaining + -- after New_Item. + + Slice (Source, + Position + New_Item'Length, Length (Source)'Old) = + Slice (Source, + -- Really "Position + New_Item'Length" but expressed with + -- a conditional repeating the above test so that the + -- call to Slice is valid on entry (under 'Old) even + -- when the test evaluates to False. + (if Position - 1 + New_Item'Length < Length (Source) + then Position + New_Item'Length + else 1), + Length (Source))'Old), Global => null; function Delete @@ -591,12 +1260,19 @@ is From : Positive; Through : Natural) return Unbounded_String with - Pre => (if Through <= From then From - 1 <= Length (Source)), + Pre => (if Through >= From then From - 1 <= Length (Source)), Contract_Cases => (Through >= From => - Length (Delete'Result) = Length (Source) - (Through - From + 1), + Length (Delete'Result) = + From - 1 + Natural'Max (Length (Source) - Through, 0) + and then + Slice (Delete'Result, 1, From - 1) = Slice (Source, 1, From - 1) + and then + (if Through < Length (Source) then + Slice (Delete'Result, From, Length (Delete'Result)) = + Slice (Source, Through + 1, Length (Source))), others => - Length (Delete'Result) = Length (Source)), + Delete'Result = Source), Global => null; procedure Delete @@ -604,82 +1280,255 @@ is From : Positive; Through : Natural) with - Pre => (if Through <= From then From - 1 <= Length (Source)), + Pre => (if Through >= From then From - 1 <= Length (Source)), Contract_Cases => (Through >= From => - Length (Source) = Length (Source)'Old - (Through - From + 1), + Length (Source) = + From - 1 + Natural'Max (Length (Source)'Old - Through, 0) + and then + Slice (Source, 1, From - 1) = + To_String (Source)'Old (1 .. From - 1) + and then + (if Through < Length (Source) then + Slice (Source, From, Length (Source)) = + To_String (Source)'Old (Through + 1 .. Length (Source)'Old)), others => - Length (Source) = Length (Source)'Old), + To_String (Source) = To_String (Source)'Old), Global => null; function Trim (Source : Unbounded_String; Side : Trim_End) return Unbounded_String with - Post => Length (Trim'Result) <= Length (Source), - Global => null; + Contract_Cases => + -- If all characters in Source are Space, the returned string is + -- empty. + + ((for all C of To_String (Source) => C = ' ') + => + Length (Trim'Result) = 0, + + -- Otherwise, the returned string is a slice of Source + + others + => + (declare + Low : constant Positive := + (if Side = Right then 1 + else Index_Non_Blank (Source, Forward)); + High : constant Positive := + (if Side = Left then Length (Source) + else Index_Non_Blank (Source, Backward)); + begin + To_String (Trim'Result) = Slice (Source, Low, High))), + Global => null; procedure Trim (Source : in out Unbounded_String; Side : Trim_End) with - Post => Length (Source) <= Length (Source)'Old, - Global => null; + Contract_Cases => + -- If all characters in Source are Space, the returned string is + -- empty. + + ((for all C of To_String (Source) => C = ' ') + => + Length (Source) = 0, + + -- Otherwise, the returned string is a slice of Source + + others + => + (declare + Low : constant Positive := + (if Side = Right then 1 + else Index_Non_Blank (Source, Forward)'Old); + High : constant Positive := + (if Side = Left then Length (Source)'Old + else Index_Non_Blank (Source, Backward)'Old); + begin + To_String (Source) = To_String (Source)'Old (Low .. High))), + Global => null; function Trim (Source : Unbounded_String; Left : Maps.Character_Set; Right : Maps.Character_Set) return Unbounded_String with - Post => Length (Trim'Result) <= Length (Source), - Global => null; + Contract_Cases => + -- If all characters in Source are contained in one of the sets Left + -- or Right, then the returned string is empty. + + ((for all C of To_String (Source) => Maps.Is_In (C, Left)) + or else + (for all C of To_String (Source) => Maps.Is_In (C, Right)) + => + Length (Trim'Result) = 0, + + -- Otherwise, the returned string is a slice of Source + + others + => + (declare + Low : constant Positive := + Index (Source, Left, Outside, Forward); + High : constant Positive := + Index (Source, Right, Outside, Backward); + begin + To_String (Trim'Result) = Slice (Source, Low, High))), + Global => null; procedure Trim (Source : in out Unbounded_String; Left : Maps.Character_Set; Right : Maps.Character_Set) with - Post => Length (Source) <= Length (Source)'Old, - Global => null; + Contract_Cases => + -- If all characters in Source are contained in one of the sets Left + -- or Right, then the returned string is empty. + + ((for all C of To_String (Source) => Maps.Is_In (C, Left)) + or else + (for all C of To_String (Source) => Maps.Is_In (C, Right)) + => + Length (Source) = 0, + + -- Otherwise, the returned string is a slice of Source + + others + => + (declare + Low : constant Positive := + Index (Source, Left, Outside, Forward)'Old; + High : constant Positive := + Index (Source, Right, Outside, Backward)'Old; + begin + To_String (Source) = To_String (Source)'Old (Low .. High))), + Global => null; function Head (Source : Unbounded_String; Count : Natural; Pad : Character := Space) return Unbounded_String with - Post => Length (Head'Result) = Count, - Global => null; + Post => Length (Head'Result) = Count, + Contract_Cases => + (Count <= Length (Source) + => + -- Source is cut + + To_String (Head'Result) = Slice (Source, 1, Count), + + others + => + -- Source is followed by Pad characters + + Slice (Head'Result, 1, Length (Source)) = To_String (Source) + and then + Slice (Head'Result, Length (Source) + 1, Count) = + [1 .. Count - Length (Source) => Pad]), + Global => null; procedure Head (Source : in out Unbounded_String; Count : Natural; Pad : Character := Space) with - Post => Length (Source) = Count, - Global => null; + Post => Length (Source) = Count, + Contract_Cases => + (Count <= Length (Source) + => + -- Source is cut + + To_String (Source) = Slice (Source, 1, Count), + + others + => + -- Source is followed by Pad characters + + Slice (Source, 1, Length (Source)'Old) = To_String (Source)'Old + and then + Slice (Source, Length (Source)'Old + 1, Count) = + [1 .. Count - Length (Source)'Old => Pad]), + Global => null; function Tail (Source : Unbounded_String; Count : Natural; Pad : Character := Space) return Unbounded_String with - Post => Length (Tail'Result) = Count, - Global => null; + Post => Length (Tail'Result) = Count, + Contract_Cases => + (Count = 0 + => + True, + + (Count in 1 .. Length (Source)) + => + -- Source is cut + + To_String (Tail'Result) = + Slice (Source, Length (Source) - Count + 1, Length (Source)), + + others + => + -- Source is preceded by Pad characters + + (if Length (Source) = 0 then + To_String (Tail'Result) = [1 .. Count => Pad] + else + Slice (Tail'Result, 1, Count - Length (Source)) = + [1 .. Count - Length (Source) => Pad] + and then + Slice (Tail'Result, Count - Length (Source) + 1, Count) = + To_String (Source))), + Global => null; procedure Tail (Source : in out Unbounded_String; Count : Natural; Pad : Character := Space) with - Post => Length (Source) = Count, - Global => null; + Post => Length (Source) = Count, + Contract_Cases => + (Count = 0 + => + True, + + (Count in 1 .. Length (Source)) + => + -- Source is cut + + To_String (Source) = + Slice (Source, + -- Really "Length (Source) - Count + 1" but expressed with a + -- conditional repeating the above guard so that the call to + -- Slice is valid on entry (under 'Old) even when the test + -- evaluates to False. + (if Count <= Length (Source) then Length (Source) - Count + 1 + else 1), + Length (Source))'Old, + + others + => + -- Source is preceded by Pad characters + + (if Length (Source)'Old = 0 then + To_String (Source) = [1 .. Count => Pad] + else + Slice (Source, 1, Count - Length (Source)'Old) = + [1 .. Count - Length (Source)'Old => Pad] + and then + Slice (Source, Count - Length (Source)'Old + 1, Count) = + To_String (Source)'Old)), + Global => null; function "*" (Left : Natural; Right : Character) return Unbounded_String with Pre => Left <= Natural'Last, - Post => Length ("*"'Result) = Left, + Post => To_String ("*"'Result) = [1 .. Left => Right], Global => null; function "*" @@ -687,7 +1536,13 @@ is Right : String) return Unbounded_String with Pre => (if Left /= 0 then Right'Length <= Natural'Last / Left), - Post => Length ("*"'Result) = Left * Right'Length, + Post => + Length ("*"'Result) = Left * Right'Length + and then + (if Right'Length > 0 then + (for all K in 1 .. Left * Right'Length => + Element ("*"'Result, K) = + Right (Right'First + (K - 1) mod Right'Length))), Global => null; function "*" @@ -695,10 +1550,18 @@ is Right : Unbounded_String) return Unbounded_String with Pre => (if Left /= 0 then Length (Right) <= Natural'Last / Left), - Post => Length ("*"'Result) = Left * Length (Right), + Post => + Length ("*"'Result) = Left * Length (Right) + and then + (if Length (Right) > 0 then + (for all K in 1 .. Left * Length (Right) => + Element ("*"'Result, K) = + Element (Right, 1 + (K - 1) mod Length (Right)))), Global => null; private + pragma SPARK_Mode (Off); -- Controlled types are not in SPARK + pragma Inline (Length); package AF renames Ada.Finalization; From patchwork Fri Aug 2 07:11:35 2024 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: 95169 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 C9874385E45C for ; Fri, 2 Aug 2024 07:17:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 62758385F018 for ; Fri, 2 Aug 2024 07:12:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62758385F018 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 62758385F018 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582763; cv=none; b=T7gsPWf3UhkCIdBjTdoRbnuwKwGBk25DDM2Ifpsb2RUu2iNKUI4WpBO65/L8yLl/qrRmmR/3jNRFa2XlCjoEmlxEKJXTuJon7Sc3zaHBRSNIYt2Mh72ApyngpJ+ytKQ7jVzJ+O/d45j6vf+d22O+HMLmuVoKNXQ8v1f51zTA2Bc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582763; c=relaxed/simple; bh=o9/caEV/BShpyhzIgkZn7A0eA5xU+HRkRuLevQhteBg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HKEa+ihsHOm7WHH9SSqOFeGoC5zZq0gaNimNKSXT6lYU+Ujel7Rml0/jkeWltlXl6g9p+Ic8bC7m41zGC416zQMa/Tu//xPSq8L7SY/Ws/MYTKmggdPLJe6qHz4I3yAA8AcxWxdLGL780x3X+tIUieadByR+bbPvUy2el1sbTBw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3684e8220f9so1577732f8f.1 for ; Fri, 02 Aug 2024 00:12:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582758; x=1723187558; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EZazqtiDttxRHwreijbAIbNB50d9xYtoojZJxE7ryYY=; b=hI5XiTNd8tNjIktueiTMfNzrad5G8GhMcoyhyjL0C64OEQVvOs8qbxXd/Tp/RwnPXz YGUV0VQevSiELe6N9Mv+TboLa4G+ntiPBuSEq8/AtD8fWvNht9vf8zLX5dq2NhnZcliF yGaxVFvBrKmSi27Oq5oD5XbaaJnqN+ucRrkRsLuFjJdJc8J6OnaCAil6GiZU+MpYLt8A jirk9te1ScMii/LBBBAtqPxolkByVzgiXEA0nqxIrMRStoWmlYqxiU84IUkj4VE87CCU VAs2YUXpMyvHlEDF/oINiKuC4NyoV8Hv22xotA0HdEDNRXN4CB+kz0hwZA1CBuTD7AE2 R7Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582758; x=1723187558; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EZazqtiDttxRHwreijbAIbNB50d9xYtoojZJxE7ryYY=; b=C6jvz4WzOOzAfgKZSUxUP/ZPoRvuxfV+n+ivYhEFAjU2c15YAgYk9ZE4jPs+kIPOWb j1b3zk14UUi35moeCvaCiFChrDhMF/RkyxLB5nWQD11qCiw3pBqAqviMdCJ257+1msfX JUKAGDnNTcwXiWRlrJYMyBJFxKkOyhqHKhr5bVk7XIN2orlu1qXK5p+qPRigc9z2iNJn C2/CFEPPX+S/FyZ0tnkBVf20TjDKYoaVe9S4mdRXsDe0pyU6BwWS65BMonad5YUS7g/2 wsdkZ+8/JPJE+ZVosNyHjHTgXVErX1e5YPfkuRq5o8czYPG4wPiRHPcBvaRFtmbFjcjg z6IA== X-Gm-Message-State: AOJu0YzQWOZ4t2s/sWM/5HTbmG3CkhiM79xspFZW+LY0uYoPEkE5mknZ 924Pigv7bq9R+JQRqDnAPEgiqGsCzzw7WlldH4oKyjXWVELH7NIIMG+VNnShmPTk1Ddn55wdSiR tzg== X-Google-Smtp-Source: AGHT+IE521DtiOYnVmMp6b+v2tN2ULH77+Kv7lWlwC4TX+vkvm8ep8YEvEy5wRIfD6n8nYEiBOnQnA== X-Received: by 2002:a05:6000:e85:b0:368:3562:7c76 with SMTP id ffacd0b85a97d-36bbbe1ad89mr1733636f8f.3.1722582758004; Fri, 02 Aug 2024 00:12:38 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:37 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 18/26] ada: Tweak container aggregate expansion code Date: Fri, 2 Aug 2024 09:11:35 +0200 Message-ID: <20240802071210.413366-18-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Ronan Desplanques This patch makes a minor modification to Expand_Container_Aggregate in order to silence a GNAT SAS false positive. gcc/ada/ * exp_aggr.adb (Expand_Container_Aggregate): Remove variables. (To_Int): New function. (Add_Range_Size): Use newly introduced function. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 59ed75e8d69..ed0dad1444b 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -6642,8 +6642,6 @@ package body Exp_Aggr is Choice_Lo : Node_Id := Empty; Choice_Hi : Node_Id := Empty; - Int_Choice_Lo : Int; - Int_Choice_Hi : Int; Is_Indexed_Aggregate : Boolean := False; @@ -6696,32 +6694,38 @@ package body Exp_Aggr is -------------------- procedure Add_Range_Size is - Range_Int_Lo : Int; - Range_Int_Hi : Int; + function To_Int (Expr : N_Subexpr_Id) return Int; + -- Return the Int value corresponding to the bound Expr - begin - -- The bounds of the discrete range are integers or enumeration - -- literals + ------------ + -- To_Int -- + ------------ - if Nkind (Lo) = N_Integer_Literal then - Range_Int_Lo := UI_To_Int (Intval (Lo)); - Range_Int_Hi := UI_To_Int (Intval (Hi)); + function To_Int (Expr : N_Subexpr_Id) return Int is + begin + -- The bounds of the discrete range are integers or enumeration + -- literals + return UI_To_Int + ((if Nkind (Expr) = N_Integer_Literal then + Intval (Expr) + else + Enumeration_Pos (Expr))); + end To_Int; - else - Range_Int_Lo := UI_To_Int (Enumeration_Pos (Lo)); - Range_Int_Hi := UI_To_Int (Enumeration_Pos (Hi)); - end if; + -- Local variables + + Range_Int_Lo : constant Int := To_Int (Lo); + Range_Int_Hi : constant Int := To_Int (Hi); + begin Siz := Siz + Range_Int_Hi - Range_Int_Lo + 1; - if No (Choice_Lo) or else Range_Int_Lo < Int_Choice_Lo then + if No (Choice_Lo) or else Range_Int_Lo < To_Int (Choice_Lo) then Choice_Lo := Lo; - Int_Choice_Lo := Range_Int_Lo; end if; - if No (Choice_Hi) or else Range_Int_Hi > Int_Choice_Hi then + if No (Choice_Hi) or else Range_Int_Hi > To_Int (Choice_Hi) then Choice_Hi := Hi; - Int_Choice_Hi := Range_Int_Hi; end if; end Add_Range_Size; From patchwork Fri Aug 2 07:11:36 2024 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: 95165 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 4EA883860744 for ; Fri, 2 Aug 2024 07:16:12 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 628233860743 for ; Fri, 2 Aug 2024 07:12:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 628233860743 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 628233860743 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582762; cv=none; b=BkMuLnuEHpkGHxFc4N8rMXozxppwrSG/FdotmyawF/CH5ae94W8DNzp1CV8QIMyUv5CYbtO82E+6NTjzAIIYOarHXLBkfvzs7mLau4RuGOSz0pIJrFNKCKqP2uJGfI3yKKZYWuyDOzTaFNsELMYqpealVqxl4b9rkrfDXXrsYQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582762; c=relaxed/simple; bh=h/AE+ts9NzHs3mEGp18ezGSY+m5+VZZFf2gJVMhDl7c=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gcQ1iM1hI/iHOz8R7oricftGTyC7AO8mmLjNengii+cFtG/JzrJjMgoEsgVFOsTb0Ipt76gwtwCOEtSlXcQ1vBM2grfq9HmMWkjel0MJUv6G+SC1GlW/c4RDpcrQXhDKukA7Przbn2MTBK27f4TWEwRZXkVkapfypUUokZNfiAs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-367ab76d5e1so3160118f8f.3 for ; Fri, 02 Aug 2024 00:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582759; x=1723187559; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A6aWcGJUhBDN7Ejl8TU0EtYVfCju+bRK5HqCtDRezM8=; b=VX0PqiF1KnjJsYHeAn4Gs7NikprZ3SNJWKYENNDIscI9AdDzVVIL3Lt8rYE/crK+Jo yHLkukDInEPPxTBTPGJvV0qSofZ90ED8ADJW8m8864xEwNICb7RiYN6hNaloxHdyhVwZ Rwhy7TO4/J9BqYohTn8PunQj2bB1SHuk1dGKN8zo4tNBS2zLCTBYmkaOkTNEIxLC/VA7 ys5zaRLlzOM/sgUBm0MJtJK/PT/K0To/t8wNkOTRlTpNeVOchAQcMRwLriwuOmznBt7K De38RFybwgg/tms5CySXjQn+RzWGm7fUybXgwMaUIcrjKWe7ftiaQpjUh6OwRX5triH2 QVPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582759; x=1723187559; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A6aWcGJUhBDN7Ejl8TU0EtYVfCju+bRK5HqCtDRezM8=; b=fZeoFwpf82cGUYaroaPyI6IPLuK81ORujgtMRh1Ffryy53UJv4VUQElwPBIF1UKvpB zerNkvH1OTLhNZNgFdYb3vKhGqnuq+XAFz4r65r/j2ts57fyppkVujBzm2NtDWtgfLa1 Qk5mIUnb7oLoYiDFi0fq6tgOFjCUVybGMDHxP2NQwrOMfYNwicRgSQotBXJ+mLfYr6g9 atzuF3YG7Knn28n0xHmkdTrJJ4fKzG5j3KP3riindFF74eyZTgv5oqYhJ5goa59JY8+t zQ/1Y0QEV+zYkOMd2GfOttGR5kSU0JcHcO0HgygGePE4T/UPfMRqe/62NPXzVIT3pKA2 mlNQ== X-Gm-Message-State: AOJu0YzsW9SBdpZRlA6RyJKRBCn0pzhbCPllmZ/mUyrfnvCT3mshe8yi dFTDQQrNVxBZwmrPOKRp9Df9PDPQCqOcwvLlgGqFwPTJYGJ4ALYm63PEIeh4cptqXufjJsxtEqi pTA== X-Google-Smtp-Source: AGHT+IEgm8fAAY9cwnuTPCGqWZ+E0c2X83gEfuJ2EKHJcf1rU9WNLnX3KWF1dQE0+Gm+8J4ojn4tmg== X-Received: by 2002:adf:f2c9:0:b0:368:c700:758d with SMTP id ffacd0b85a97d-36bbc10ccddmr1424777f8f.28.1722582758819; Fri, 02 Aug 2024 00:12:38 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:38 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 19/26] ada: Plug loophole in handling of No_Raise pragma Date: Fri, 2 Aug 2024 09:11:36 +0200 Message-ID: <20240802071210.413366-19-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou Unlike the aspect, the pragma needs to be propagated explicitly from a generic subprogram to its instances. gcc/ada/ * sem_ch12.adb (Analyze_Subprogram_Instantiation): Propagate the No_Raise flag like the No_Return flag. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch12.adb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 6b98343aeeb..25821cb7695 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -6069,9 +6069,16 @@ package body Sem_Ch12 is Set_Has_Pragma_No_Inline (Anon_Id, Has_Pragma_No_Inline (Gen_Unit)); - -- Propagate No_Return if pragma applied to generic unit. This must - -- be done explicitly because pragma does not appear in generic - -- declaration (unlike the aspect case). + -- Propagate No_Raise if pragma applied to generic unit. This must + -- be done explicitly because the pragma does not appear in generic + -- declarations (unlike the aspect). + + if No_Raise (Gen_Unit) then + Set_No_Raise (Act_Decl_Id); + Set_No_Raise (Anon_Id); + end if; + + -- Likewise for No_Return if No_Return (Gen_Unit) then Set_No_Return (Act_Decl_Id); From patchwork Fri Aug 2 07:11:37 2024 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: 95177 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 46715385DDFA for ; Fri, 2 Aug 2024 07:21:23 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 178FF385DDF9 for ; Fri, 2 Aug 2024 07:12:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 178FF385DDF9 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 178FF385DDF9 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582765; cv=none; b=MJ03k4ZI4mhhlsbekgLzHSk0T323V5SGjnCegBBmQTJK35ReVqxGXrjvanKpm5pmkpKf1png1OjpXsKu9Cfn3gSZIiLKVCwmyiL1kfcVy0ogsfMKkxMtcDdLQqxPoa9Kv4ABcEF7wtuoZzBCOpdC3HvsRQw+S1jtWTqoJO/8phE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582765; c=relaxed/simple; bh=98bORN89zeIa9NVZ25SNjbgm36h4diqNqt8AbbIERzk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jGCPofkkgnpnSwkFD/btV5/eld+chImM5fTtRlQ+J7G6krK9zJz8/ooIYeA5XPakitFRxxMI12Pktu9GmhvNP9MjLzO1yOYHdW9cM//JS6mwRIRP3bjhNZt6paeilLaXH7/uMd3ejO8rXylhd2HOlTEtzPIurR7L2QRI+aoT0pI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3684e8220f9so1577745f8f.1 for ; Fri, 02 Aug 2024 00:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582760; x=1723187560; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=onYAEebDkrGUqTBfwo9b8zZHuld7V5zHUh4EjDc6i/k=; b=awy7z7b4xFTgWWN966A8G5LPJJsGfUoXeXQa4UXsAOSVfEP+nHYBVMZCecoH9bmrLX 9/KZfMQtFZZdakibC8WH4z8QvsoHfPt52qyb0ZXjaWTD20Fucjz9Ih0mw8l1dH7/V/zk bIjema3uEXBop77+aEcQuIugbTNECwdiJ9VyxxxUdbWV79CYjRztRWoaHIjqwZL7Nj/l E9erExpgHWJ9SBf3nhqifL7HtQg+NxSenzxaZ9lb5MSQY6ddFTr04a8xN6ULNFkGubSB 3aEbhsonFiKTywy2Gd0KW/67YT5hpJxIsn4WGSEaqS+rOMNaFstQpTSy5slzK6/yQCTo eRag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582760; x=1723187560; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=onYAEebDkrGUqTBfwo9b8zZHuld7V5zHUh4EjDc6i/k=; b=YC4mD+u/1w2BtnIs8NQBHysXtXYGe1eZJFpUFJFpkG2a9TWyQoRTlOcgJXvn4zRgR8 fgvOENTmbzpWvascUB4AQcDkt8eou6xBhxbwvHIAjSE6n+sKQmbCCpz9GCgWtpkgHDtY 2w7aJodCW5fPD+Bgfs/zHSrrb+VzZW36vN9ncsF3br2BJb21Pc4vOONi/Ou+sb8oCnoy I+yFBzbIjKpI1ozPKZYfXgmURb0JRgsZSUUIOZp5O7GKtzpiSIcugvaKDUnqmrre3xrV JKNPbH8NgaXswmn/oWfbKSBZU5dxcKnEh3qSF3fmIovDTjO+vX9auFFuaJjB4y/qGVM9 uLxw== X-Gm-Message-State: AOJu0YxNnuj0FTlNYF9FTwaLYbmzvDPdcHfLI+goTRl7ZbPKFBsQ9INl g6pZEA4bRYNPoqOaRmFb5u8RbU0V5RCSTXP3eGd30SKYQNOxfMVW1DUaJuTCfdC37TDcDonbAi+ +XA== X-Google-Smtp-Source: AGHT+IHTfoPTcyqHjSF3aS3gc+m7KW1PpK9+RKXne96c9nvxjfNN4yetamaphYbGH5TJKmYZATSTpA== X-Received: by 2002:adf:ab09:0:b0:366:dee6:a9ea with SMTP id ffacd0b85a97d-36bb35de1c4mr3206571f8f.26.1722582759658; Fri, 02 Aug 2024 00:12:39 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:39 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Gary Dismukes Subject: [COMMITTED 20/26] ada: Errors on legal container aggregates with iterated_element_associations Date: Fri, 2 Aug 2024 09:11:37 +0200 Message-ID: <20240802071210.413366-20-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Gary Dismukes The compiler rejects various cases of container aggregates with iterated_element_associations that include a loop_parameter_subtype_indication or that include the "reverse" keyword. The fixes are in the parser, for naccepting the syntax for these cases, as well as for properly accounting for reverse iterators in the analyzer and expander. gcc/ada/ * exp_aggr.adb (Expand_Container_Aggregate.Expand_Iterated_Component): Set the Reverse_Present flag when creating the loop's iteration_scheme. * gen_il-gen-gen_nodes.adb: Add flag Reverse_Present to N_Iterated_Component_Association nodes. * par-ch3.adb (P_Constraint_Op): Remove testing for and ignoring of Tok_In following a constraint. It's allowed for "in" to follow a constraint of loop_parameter_subtype_indication of an iterator_specification, so it shouldn't be ignored. * par-ch4.adb (P_Iterated_Component_Association): Account for "reverse" following the "in" in an iterated_component_association, and set the Reverse_Present flag on the N_Iterated_Component_Association node. Add handling for a ":" following the identifier in an iterator_specification of an iterated_element_association, sharing the code with the "of" case (which backs up to the identifier at the beginning of the iterator_specification). Fix incorrect trailing comment following the call to Scan. (Build_Iterated_Element_Association): Set the Reverse_Present flag on an N_Loop_Parameter_Specification node of an N_Iterated_Element_Association. * par-ch5.adb (P_Iterator_Specification): Remove error-recovery and error code that reports "subtype indication is only legal on an element iterator", as that error can no longer be emitted (and was formerly only reported on one fixedbugs test). * sem_aggr.adb (Resolve_Container_Aggregate.Resolve_Iterated_Association): When creating an N_Iterator_Specification for an N_Iterated_Component_Association, set the Reverse_Present flag of the N_Iterated_Specification from the flag on the latter. * sinfo.ads: Add comments for the Reverse_Present flag, which is now allowed on nodes of kind N_Iterated_Component_Association. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 1 + gcc/ada/gen_il-gen-gen_nodes.adb | 1 + gcc/ada/par-ch3.adb | 4 ---- gcc/ada/par-ch4.adb | 12 +++++++++++- gcc/ada/par-ch5.adb | 12 ------------ gcc/ada/sem_aggr.adb | 2 +- gcc/ada/sinfo.ads | 6 ++++++ 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index ed0dad1444b..25af78a4da7 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -7019,6 +7019,7 @@ package body Exp_Aggr is Loop_Parameter_Specification => Make_Loop_Parameter_Specification (Loc, Defining_Identifier => Loop_Id, + Reverse_Present => Reverse_Present (Comp), Discrete_Subtype_Definition => L_Range)); end if; end if; diff --git a/gcc/ada/gen_il-gen-gen_nodes.adb b/gcc/ada/gen_il-gen-gen_nodes.adb index 7224556accd..327ff376d12 100644 --- a/gcc/ada/gen_il-gen-gen_nodes.adb +++ b/gcc/ada/gen_il-gen-gen_nodes.adb @@ -1489,6 +1489,7 @@ begin -- Gen_IL.Gen.Gen_Nodes Sy (Iterator_Specification, Node_Id, Default_Empty), Sy (Expression, Node_Id, Default_Empty), Sy (Discrete_Choices, List_Id), + Sy (Reverse_Present, Flag), Sy (Box_Present, Flag), Sm (Loop_Actions, List_Id))); diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index 01dd45c4f23..a5f4319debf 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -1196,10 +1196,6 @@ package body Ch3 is elsif Token = Tok_Left_Paren then return P_Index_Or_Discriminant_Constraint; - elsif Token = Tok_In then - Ignore (Tok_In); - return P_Constraint_Opt; - -- One more possibility is e.g. 1 .. 10 (i.e. missing RANGE keyword) elsif Token = Tok_Identifier or else diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 9c9b0d70207..8b491c2cfd7 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -3584,6 +3584,7 @@ package body Ch4 is Iter_Spec : Node_Id; Loop_Spec : Node_Id; State : Saved_Scan_State; + In_Reverse : Boolean := False; procedure Build_Iterated_Element_Association; -- If the iterator includes a key expression or a filter, it is @@ -3602,6 +3603,8 @@ package body Ch4 is New_Node (N_Loop_Parameter_Specification, Prev_Token_Ptr); Set_Defining_Identifier (Loop_Spec, Id); + Set_Reverse_Present (Loop_Spec, In_Reverse); + Choice := First (Discrete_Choices (Assoc_Node)); Assoc_Node := New_Node (N_Iterated_Element_Association, Prev_Token_Ptr); @@ -3644,6 +3647,13 @@ package body Ch4 is when Tok_In => Set_Defining_Identifier (Assoc_Node, Id); T_In; + + if Token = Tok_Reverse then + Scan; -- past REVERSE + Set_Reverse_Present (Assoc_Node, True); + In_Reverse := True; + end if; + Set_Discrete_Choices (Assoc_Node, P_Discrete_Choice_List); -- The iterator may include a filter @@ -3673,7 +3683,7 @@ package body Ch4 is TF_Arrow; Set_Expression (Assoc_Node, P_Expression); - when Tok_Of => + when Tok_Colon | Tok_Of => Restore_Scan_State (State); Scan; -- past OF Iter_Spec := P_Iterator_Specification (Id); diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb index 6de9ef0089e..a245fa1c08b 100644 --- a/gcc/ada/par-ch5.adb +++ b/gcc/ada/par-ch5.adb @@ -1836,18 +1836,6 @@ package body Ch5 is elsif Token = Tok_In then Scan; -- past IN - elsif Prev_Token = Tok_In - and then Present (Subtype_Indication (Node1)) - then - -- Simplest recovery is to transform it into an element iterator. - -- Error message on 'in" has already been emitted when parsing the - -- optional constraint. - - Set_Of_Present (Node1); - Error_Msg_N - ("subtype indication is only legal on an element iterator", - Subtype_Indication (Node1)); - else return Error; end if; diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 5f7c7321f4f..565f2cb8a79 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -3818,7 +3818,7 @@ package body Sem_Aggr is Defining_Identifier => Relocate_Node (Defining_Identifier (Comp)), Name => Copy, - Reverse_Present => False, + Reverse_Present => Reverse_Present (Comp), Iterator_Filter => Empty, Subtype_Indication => Empty); begin diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 742527fcedb..beecc2c253f 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -4203,6 +4203,11 @@ package Sinfo is -- At most one of (Defining_Identifier, Iterator_Specification) -- is present at a time, in which case the other one is empty. + -- The Reverse_Present flag is present for cases where semantic analysis + -- later changes the association to have an N_Iterator_Specification + -- rather than a Defining_Identifier (due to the "discrete choice" + -- being resolved as an iterator name), and needs to set that flag on + -- the N_Iterator_Specification node. -- N_Iterated_Component_Association -- Sloc points to FOR @@ -4210,6 +4215,7 @@ package Sinfo is -- Iterator_Specification -- Expression -- Discrete_Choices + -- Reverse_Present -- Loop_Actions -- Box_Present From patchwork Fri Aug 2 07:11:38 2024 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: 95173 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 F0389385EC55 for ; Fri, 2 Aug 2024 07:18:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id B3621385EC59 for ; Fri, 2 Aug 2024 07:12:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B3621385EC59 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B3621385EC59 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582763; cv=none; b=JQ0fNNfZdjgGDL/YNRm4rmpIAoltcyIu9GIpVCvnsJW16f5aL7zuV6In1zqMJz4gPZ577RhgW730ENkoxbmWW6z4ZnK7v97E1PanAgQ6rmuhXQyqoVYPiwyobDBH3A1XlB5kXBToLFA1xAGwCuACquUqiDYKcsn5o3EW99NkKBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582763; c=relaxed/simple; bh=XuA3MkZIklIFugY3LdAM7KFAndkHU5YDgx39Pv487DA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GE7vOj5D8nnW7iPzXITbAtzXyqV5f2EUTRAR6PPohnjrb4sdkcD5/EIB3WSB0yANez7gGyyZUJ+5Dg4tEgBVqLSJTpBxXmn7ZtYjHEfNXHlSVShhbzkOvhOPgcEGbWJxwGblbRd83wKzZ22/prcgULrAU12EZ8Zju+w9uQk09Kw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3684407b2deso3946638f8f.1 for ; Fri, 02 Aug 2024 00:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582760; x=1723187560; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6LRHaimFDUgPP3c4Wtio0/QCdfokDfJb5SGVyLr59PU=; b=h0QW53ufznNpFxzihI1YGMJu8bh7lqeHtvmapGYcY5AT5LJe1qA8gHumzFKfoAm7a5 MO1qDqQUpOLiFl7cNOlsjUGrw0c74RpAC7muE5d/RCG0NdVBvNsYS8QHquHCnLW3VFL2 5c04AvtZ+xyskbeyCEhIfw7N5ebHynIfkI1/wmzEAkYD/bVb7nP1k+R2AklXeG+ss/mL SQMkqpb9qluv4TwDWdDpqXdeLZluTgEiz02MIhTxYOp1BBgvCWQEwv80quVBM3fISLGh ZxFisUt7vCCrhMFbjRXJnlxgkL5WT0jdH928urCwUU22J2XFvNMMrYSz/iNB3dMM9gVC Kg+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582760; x=1723187560; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6LRHaimFDUgPP3c4Wtio0/QCdfokDfJb5SGVyLr59PU=; b=GBnnv1JeeCX72IRwl8fqOpAjp+Qdys1+3ALksHeHv3K2NRLoLuJZdUxJYZd7qvJTzK ow0cfA+/rLTtM6IJrsf4XmcdJ7DCXUUnI83CFiUNvbX5qT1BnQ/hbzQpk+JHLCoyatug M/Ve+sCryjPhsqakpt1Rc3xcyW+DeR6IztTIYTu/pqejcUpAjpUvvoIxy1otTQiTtgiZ Upp5n0+wCeJh6jSiPCArQJwiztoPEKjOkPspOPm7VN5GhxIOv3/QJWPrfnPs3qWwU0zG OCpV3TIk86Vp91VtYnmfDVH5o9Qdf/4evWuqW98Rc6ES8j5lp50ltblN50axSh2yXgzP zQfw== X-Gm-Message-State: AOJu0Yx2bbn6EvRJqb6yLq0SJK9dodyYNn3qABs1UfQjKVtivXSpXeqp K+aSrOWIcbUh8zbXrchWoWPxn4it32DmUG/RsabqRTqGru1y0uuGHJTQGqJRKsFDpCN6N7JyWKH hXQ== X-Google-Smtp-Source: AGHT+IGLG3BebhUJlZ4TUvxR1wIVZ+5CoEsxKcIFwO0TX3EVK8B7NhD9/kCKFebG67g3d1+yQ4mZ3g== X-Received: by 2002:adf:ec03:0:b0:368:714e:5a59 with SMTP id ffacd0b85a97d-36bbc0aeba6mr1733125f8f.11.1722582760469; Fri, 02 Aug 2024 00:12:40 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:39 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 21/26] ada: Simplify code by reusing Choice_List Date: Fri, 2 Aug 2024 09:11:38 +0200 Message-ID: <20240802071210.413366-21-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_aggr.adb (Gen_Assign): Fix layout. * sem_aggr.adb (Empty_Range): Reuse Choice_List. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 8 ++++---- gcc/ada/sem_aggr.adb | 8 +------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 25af78a4da7..7a2d0570dbd 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -1010,8 +1010,8 @@ package body Exp_Aggr is -- Returns a new reference to the index type name function Gen_Assign - (Ind : Node_Id; - Expr : Node_Id) return List_Id; + (Ind : Node_Id; + Expr : Node_Id) return List_Id; -- Ind must be a side-effect-free expression. If the input aggregate N -- to Build_Loop contains no subaggregates, then this function returns -- the assignment statement: @@ -1237,8 +1237,8 @@ package body Exp_Aggr is ---------------- function Gen_Assign - (Ind : Node_Id; - Expr : Node_Id) return List_Id + (Ind : Node_Id; + Expr : Node_Id) return List_Id is function Add_Loop_Actions (Lis : List_Id) return List_Id; -- Collect insert_actions generated in the construction of a loop, diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 565f2cb8a79..656d789de73 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -2735,15 +2735,9 @@ package body Sem_Aggr is ----------------- function Empty_Range (A : Node_Id) return Boolean is - R : Node_Id; + R : constant Node_Id := First (Choice_List (A)); begin - if Nkind (A) = N_Iterated_Component_Association then - R := First (Discrete_Choices (A)); - else - R := First (Choices (A)); - end if; - return No (Next (R)) and then Nkind (R) = N_Range and then Compile_Time_Compare From patchwork Fri Aug 2 07:11:39 2024 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: 95178 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 9E85B385E45B for ; Fri, 2 Aug 2024 07:22:35 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 73017385EC57 for ; Fri, 2 Aug 2024 07:12:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 73017385EC57 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 73017385EC57 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582765; cv=none; b=x7lzueRcUTT//Um63vlZRz4bmQ9Sx277PFUc7qaMhmyrSpuiLIggRalNgoI1nfoDxXSBkhyjRyGc3Y3UOs+HAdqrERAecS6liagSq3Ny2WfzIo5mB3q2PgQB11CDVOoY+bxMhqywBhE3xd5hLxti/1pO9zwHrWjSKpertcfv3kE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582765; c=relaxed/simple; bh=YDsdpZqwbiDEMJ3kepfwAijLjF2kr5D01pLpXfQgs9E=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=pKU7CdgzvapzB4PzorscPGEyjJ5vMg3A9W8kx/ldRYWfDdmKipjBlCRnCMJrhOKiObXHfvMgDTioGi6Z7fpfqG9ejXh56g1JNjJdxFSn0QY/VJKa2UMBXtnt2f0QXWa6EXcL/p9mVidwzd3ohop9V4e0Rwwt4Tn99qvnabVJD/8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-428243f928fso42065525e9.0 for ; Fri, 02 Aug 2024 00:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582761; x=1723187561; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1flnFYkMZ4hrKOmI34ffNjJZzEc9nOXf3vSZPEq+IcQ=; b=ARJmNR1qix8b9IOo9Nki+T49amekSNVvfWH3T8q6vgn+Y9eSRhlxBHILi35755EbcX BQILIFbRV9BfMVUyca0MR0myXhsWgCdcZyCEFdUdhYtusbsXTSPu+felJKUThHN3wWR+ 4yAe2Z5nDRmfSNSW8TAIM7Acii/FHsIwBmDyq8Ir8mi9Eyd3XEKFycFzKp2gF5fPpryX An/ZjB1r5MHb3CWgTdnrGMKoOlPyF5B5IWa44EQhybk12ZUM7Pd77VC2cP2G1dddDO3f xldUKycO0ql/Kw/cbXjQm4BeO+gb6xI5n/thddDmm7HjN474409dbujy4gfApv9Ruwyo 3aXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582761; x=1723187561; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1flnFYkMZ4hrKOmI34ffNjJZzEc9nOXf3vSZPEq+IcQ=; b=wZNewjYfC2YQ8c/EQyIlalKNay1DolpJ9E1e3GnQA1iOV5B6abu13Rv6g6MTKrL5Um J98Qa10P5mnaKE4TCB+8yg+MGbYHqXT/fD6uwCzTg65y8FlvF9U/vwhnNtWoDXeHLI5B eygBuD31+IH281bu5HIrDoXYYEKNIfJEkM9FIr4K3bBFZg9rM0QJsyxcpWYfKsL2hT1x Q81zY0qRpz1FQNeag5H1nFIsv6dCL8pLHwps4H9vEl6jDjdOLzmUHel/JpyyNj6eT/xC ZwzfjUoKRhOT05pibbqJbG9aPrOX4Bt48+Rzmofuc/JZdHk5mh6CIHTfixoIbHXLiE8X MaQw== X-Gm-Message-State: AOJu0YyJ4ICHOdQmA6Qf1vww5eVm9Y3QwOmc79AReD9L5B9/aGhBeSJ0 C+I8H+hPPQCcrqlD1db22kFd6jY2E2BRqcYEjiZHjHqe4Y9Mb5xK/rtl+4/u/2PLicio/RyS4Y2 qSQ== X-Google-Smtp-Source: AGHT+IGZb8Kn5yizRkkPQCxO+I9TBIPSZgH4xW88x695z5ZuR54rcOymUM/+zgnkqKurfC0Gi1kHwQ== X-Received: by 2002:adf:f412:0:b0:368:6583:5b09 with SMTP id ffacd0b85a97d-36bbc1a64d9mr1842948f8f.46.1722582761208; Fri, 02 Aug 2024 00:12:41 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:40 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 22/26] ada: Refactor negated conjuncts Date: Fri, 2 Aug 2024 09:11:39 +0200 Message-ID: <20240802071210.413366-22-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_util.adb (Insert_Actions): Move negation in front of complex conjunctions. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_util.adb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index bd8bbb39d9c..bde50687597 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -8146,12 +8146,13 @@ package body Exp_Util is -- not already set can lead to gigi assertion failures that -- are presumably due to malformed trees, so don't do that. - and then (Nkind (P) /= N_Iterated_Component_Association - or else not Is_List_Member (N) - or else - List_Containing (N) /= Discrete_Choices (P)) - and then (Nkind (P) /= N_Component_Association - or else Present (Loop_Actions (P))) + and then + not (Nkind (P) = N_Iterated_Component_Association + and then Is_List_Member (N) + and then List_Containing (N) = Discrete_Choices (P)) + and then + not (Nkind (P) = N_Component_Association + and then No (Loop_Actions (P))) then if Is_Empty_List (Loop_Actions (P)) then Set_Loop_Actions (P, Ins_Actions); From patchwork Fri Aug 2 07:11:40 2024 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: 95171 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 DD9A1385E833 for ; Fri, 2 Aug 2024 07:18:02 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 2E2783858430 for ; Fri, 2 Aug 2024 07:12:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E2783858430 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2E2783858430 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::431 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582765; cv=none; b=FGgN58Bc85MC1C52+iKIqEETZYM4YQGQiSlLrheodQE1pPgKuJP/qSEu5C3BKtSazOpQ9aUi2A23rSJnb60c0MK34kW6L9IBM4BZTPTxLtDoocqVsTVKi+4OQr0buX2Lo6IL9JM4HBlYWCo543GECC4/e+1HhhXXEQOLZ8EXwlU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582765; c=relaxed/simple; bh=7hCBWVZOzTO6dgkDBQq6w2JHpZN1W5Iuu5G5NbTDqWM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ufDeJXvECJ8J2Qi21Shn60yUDoskAhWxZj8WOti4+RxPHSfkgL7bpTj664yLgq8OSE/8ekGR3onRDEJf//CZuCUUdxOWQg+Tdu9KM9efqIcHe8ToOkpJh62Kdg131lC4OW0DxBpNA9rzMYFpSMtULiQzaVtiduzyxBWJ6eveGk8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3685a5e7d3cso4530025f8f.1 for ; Fri, 02 Aug 2024 00:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582762; x=1723187562; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o6dhh/nunSGuruYxvhHHYS+1PZk2dXaIhsH0OYnekdI=; b=baNhXPYsHPvjUzUeYQ9mL/yhgW+1b441MpWi5V3lSD3HEL7i1vm/Fl/t7mrFfZdrth dB85ZJjGwokiFIGzdZIPDi2EX6J5KfRNm5rkBm4x/bxN9OqYgdA2xWubrqNUXWySIbkP A6DfKGypyfwF07ticlisv6vAI65gxlbyZiVuoullPuNkOEmiEf6I5qjWFi8wDft6h/X1 u6lh77YMpBVat3Ajd0mhqiKxDW1SQNQpjKwvYyCP6EOB9X60Q8o0SOQLvSgvZMIeONjJ /OBbraGcMywW29FpsFT2QBVXRLJSkdrCR4qfryhiREwFf1fh67uB2pErFBURKeKWFV7z xBvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582762; x=1723187562; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o6dhh/nunSGuruYxvhHHYS+1PZk2dXaIhsH0OYnekdI=; b=v10ivg0Vlq4nDn8QGtr87HBfrJKRsQIlIkUck64tIVzmG3FEWHbetXxIDdJpp+aRg7 qiSjmyOCBcOdOXl8eO5W+GUBxbWMy/bIb2x5MIiKlivmWHXZ7C55e4efJSkhkCNfgIgy OOTStCZrXaxOUpAdyzeolCFgu+jAstbC4/G4EwRrgVeJhxk9y8Ktsf6UdGwDw9syGhuo VpkhXbTgI7UTEeJHY3lXNjDV+oYS9mR6fRL5Axm9PkCxIBSDtp6mORtDxA2kuNjIm50X lqmuV9k7uLshQGiPRTMXbjGkmkaFCeeKrJA2RYSfA7vqc0mYyRWoQX7KtgxAhyyRW3qc 0oCw== X-Gm-Message-State: AOJu0YzUKRGV7dCC3cQiuBbNg9g95fm1GmktlAef0a9poBgsV+otYhni 2n74jUcxzCL/G0CQyMz93sST8LtZxwzw0QHaVbXQrcXhRrTa+oWOok9OrRQxEftHzrpTN7AUcgv iEA== X-Google-Smtp-Source: AGHT+IG0MfVBcgjtaNC3Ge/h1OGqq9arcRahjOy4fCGPvA0qp9ZM4OZSH1S7qii84iqshFu5Kiu3yw== X-Received: by 2002:a5d:568f:0:b0:367:9621:6fa with SMTP id ffacd0b85a97d-36bbc131530mr1506113f8f.37.1722582761938; Fri, 02 Aug 2024 00:12:41 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:41 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 23/26] ada: Simplify manipulation of the list with loop actions Date: Fri, 2 Aug 2024 09:11:40 +0200 Message-ID: <20240802071210.413366-23-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek Code cleanup; behavior is unaffected. gcc/ada/ * exp_aggr.adb (Add_Loop_Actions): Change manipulation of list to avoid unnecessary calls to Parent and Loop_Actions. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 7a2d0570dbd..8496fcd9b00 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -1262,9 +1262,9 @@ package body Exp_Aggr is elsif Nkind (Parent (Expr)) = N_Component_Association and then Present (Loop_Actions (Parent (Expr))) then - Append_List (Lis, Loop_Actions (Parent (Expr))); Res := Loop_Actions (Parent (Expr)); Set_Loop_Actions (Parent (Expr), No_List); + Append_List (Lis, To => Res); return Res; else From patchwork Fri Aug 2 07:11:41 2024 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: 95180 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 E815A385DDEC for ; Fri, 2 Aug 2024 07:23:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by sourceware.org (Postfix) with ESMTPS id 488EE385E45D for ; Fri, 2 Aug 2024 07:12:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 488EE385E45D Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 488EE385E45D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::134 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582768; cv=none; b=b7Y/dBs0M9/cPl0yYchgkbKjXpiSai52pGd5rB1yzJcMlh7RQIAdo7hveOUm/i5ZrXT9SRxHkGKTE6sBn15/KxOwGWCaKpXKcg7582Jy/jfAYQigacWFxZq+9xO+fXlxFBQVMctfJYo3tYD4mAWX3bLAPXQOD0hew3/8KsSmUF0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582768; c=relaxed/simple; bh=nuWiPBFgzalcrduGFW8hzSFkkgcXo6nmfp5cEN+K5QI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nfazLvYQ9F8SFQES9aUd4z5uK4JCnr238SOL/DGenzoEpOjkYzmWlzdjVqwnJfZGZpUiDr+xXFm+cj/kldNL0l5LYjwXyyLqbrugi/EcjNdi2GwCr05DaQppiZsHrWawFx3cKDsy0rx2e+1Scp4hYqEz2hGihIFpXj/KD5b4Nng= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-52f008aa351so11247112e87.0 for ; Fri, 02 Aug 2024 00:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582763; x=1723187563; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HJiYDS95h2waClrzdCyd1m4+ZqHAUdYQPyf6RJVhYGQ=; b=dVwHVzVNw8de7JTmSUY3V7l7dxwR9mLKurSAXfnhLDRXULtpUwK4rmI+c/Au1FQZtH 0Oz2ISMqE5WRUGKjfW1424gns8rs9iK/EiW49eZIWljC7KjmjEsfrBr8Yf7KzwS+ltNo jAbxw/hIBl4Zagqij32a5wSX+PE0Z93iV+4YsNxDbDyye+IsAAtZrg2ZPRU1AYhCTKa0 vHK2TE4mUTqoZ0lSPTlSYrsv4T4yTAd6Ety6V3wltGxSQTWZQ5xbvwgkYVuegQRLSz6z sHlXkzFhzAy6yOiS1+KI/g8s65nh7Cp7FlSjM+PNisPHnwOnmKk+t+/kMD8KMsGgf9x9 V18g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582763; x=1723187563; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HJiYDS95h2waClrzdCyd1m4+ZqHAUdYQPyf6RJVhYGQ=; b=vsRByM/NlZHsddkp96Lj1yVWWvA2NGzlLPPCRoPfLijNgHO/1OfO/ZAJLjfF+fE9Dc Qhr3GNdyJYVgwJfaeRN7mZn1Airw+TLBqhJwcIDh8B0u6CSfopp6QcYAtsIICoA57ykD 36atMUVApKNFnpbV+R7Vlk1aLX4LJdfIbOcGSxenALEZfl3HB3nJ955H9gjiCEbQaZ6m KB+44Z/McJSDxj/urfH4ie+nLoGT6EU4JRNqY4eaDEiLpgoIaRKW7LEoMnkKNq/LFFiA qsOEWZiF5ZD89gsBVoU/gHKLExsLb0PsQ3a9iNo1/ICRJ5+csXgTAXN1b5Mtg9l714oi P14A== X-Gm-Message-State: AOJu0Yz1onReYZ7X55CWirVqh60R8JWJEQrM5TFlXyzD9O+ZMyq14fWE QXM27XhbmFwpaj/pdMfiBwvnJmIrFn9OHFyynjQ9fzeFpeyf62FPZKGM+GKWihPanzDznQItFu+ QcA== X-Google-Smtp-Source: AGHT+IFfsd71HzwRb092wbAmjPwZsnqCV/y0RlAEMuiI2n+wI1f4XnzzWafk7/ieGrE7/f0VFL3AYQ== X-Received: by 2002:a05:6512:398a:b0:52c:def3:44b with SMTP id 2adb3069b0e04-530bb37f552mr1369676e87.31.1722582762667; Fri, 02 Aug 2024 00:12:42 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:42 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 24/26] ada: Remove unused null branch Date: Fri, 2 Aug 2024 09:11:41 +0200 Message-ID: <20240802071210.413366-24-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_util.adb (Insert_Actions): Remove null ELSE branch. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_util.adb | 3 --- 1 file changed, 3 deletions(-) diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index bde50687597..ef8c91dfe94 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -8186,9 +8186,6 @@ package body Exp_Util is end if; return; - - else - null; end if; -- Special case: an attribute denoting a procedure call From patchwork Fri Aug 2 07:11:42 2024 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: 95175 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 5A78E385E837 for ; Fri, 2 Aug 2024 07:18:59 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id C94DE385DDC0 for ; Fri, 2 Aug 2024 07:12:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C94DE385DDC0 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C94DE385DDC0 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582768; cv=none; b=rZeFTkSgyfkUXZWujyoxzigsM4Pr+bAL3ovxcVY4nmxIt3hD1X5pJpk9PLSlYbde/WKkNL4UfT3QDOITFbBSLnPic3Rwt9sqjZcgKkDTRfCSTAvkFr6Ok8MMj/LjJ4pacDwQjqgxXVbI51s4Gl+jBv9jIrVnB17H65uPU7EuAhY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582768; c=relaxed/simple; bh=mD5HSSee7KGjZCLOFBRxARR6UowQB0fowCFs4UjG/HU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Uggy6Hut8LpNwRCxlJayqB1uVq3Eeox2fMPZz9SWXL3lc15lYJ0LYWPNTEJ4EHHUnqM5c1LU3xgI+Pi0iWTx49gKEZcDATuX2RpJJgz0UB7tFqNy1Bo2y2uYXQZ3sC+AdsmmT1VpCXFdakogBLeipZrn2v8G2oVg2YM8q//vK+0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-36887ca3da2so3614241f8f.2 for ; Fri, 02 Aug 2024 00:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582763; x=1723187563; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=64prF6zwfSXaSeEUmwR8e/fmDtEbPw/TpaVYfeWBCOs=; b=CoIWoPVd1dp79uC5wpCVhiKtow13Fz/o0hJqgnVvm0dywgN7hupctcbh2HECYljfRt yRQWp2ZYMVHgagbj+y11vrgSxTJ9iaEVjcrAZpifJXCPl6q7M2lRFuknJC/nYb9DoazE prTPTpXdTBSv0NHRBifY0u6whb02lkomzQkBbjfiD+hzssE4dwm4l2q0ai04RQDAoES1 Q23RKppHiUtrAzF56k3RDSUuwjGllSy1xwQdQs+v6g82BvJ16zFYvRpvXFkMlRlkEsj4 PZGlfV2hBUBebtsSpkuT92MaZOlxzkxbJEMYMggJnxzTx7+dPDo/Zd6UHsEVbKqJ9D/c utoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582763; x=1723187563; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=64prF6zwfSXaSeEUmwR8e/fmDtEbPw/TpaVYfeWBCOs=; b=WUImhg8dIsm7p2G+MdSTRpyObpCgMVjKg13yMQ/byirzj2DpOnM0Qb/ddyiz4i6lz5 ejmTm9QR6FYBHmIeHKmFQqOcS4mR8R48FWcLzS6+Mtox2aqyIbl5fzmXqTOuinxaspXs UmSxELVTBfmHYQWH3HizVSJanmBcs9RCIw4k1Ar+gzuIWmdCczwufIoSF9AiaC7HNUiS /114n5zAM2RWfTYMTDn+xw227P0oBscLEYmU/ilvJYqJ8xBOIQ89Faj5riKXwRifV/mB q0LUiM78x1bBU7kCm9LM9HeCB/JJBdknze2oyVkzh+DHD3CR+gKKgK0vc0rY6dzg+i/t FbVg== X-Gm-Message-State: AOJu0YwGcjPnC8js5YuaVmVvd3te2ZAtKSXTYQyo5Ba/tLENF6CshER5 LW+ZZEJyim/gXg1ckF4gL9ReLyzajBNtIZBtpB9wLsH6chG6flsom8wug4Fxb4a+XtpiYsWEZPo XaA== X-Google-Smtp-Source: AGHT+IG0dR3u7gf9fwg9pVTeenUGjNG/pZNq1zwcjo2iqiuqONtxiWq7lQkUhFvD8sVBQP+Q6qtJHg== X-Received: by 2002:a5d:49cb:0:b0:368:7e10:6995 with SMTP id ffacd0b85a97d-36bbc107e20mr1225025f8f.17.1722582763472; Fri, 02 Aug 2024 00:12:43 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:43 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 25/26] ada: Fix handling of iterated component associations with sub-aggregates Date: Fri, 2 Aug 2024 09:11:42 +0200 Message-ID: <20240802071210.413366-25-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek Fix a number of problems in handling of actions generated for a 2-dimensional array aggregate where the outer aggregate has iterated component association and the inner aggregate involves run-time checks. gcc/ada/ * exp_aggr.adb (Add_Loop_Actions): Actions are now attached to iterated component association just like they are attached to ordinary component association. (Build_Array_Aggr_Code): If resolution of the array aggregate generated some actions, e.g. for run-time checks, then we must keep them; same for the Other_Clause. * sem_aggr.adb (Resolve_Iterated_Component_Association): Unset references to iterator variable in loop actions (which might come from run-time check), just these references are unset in the expression itself. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 14 +++++++++++--- gcc/ada/sem_aggr.adb | 9 +++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 8496fcd9b00..aa6079d82b5 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -1259,7 +1259,8 @@ package body Exp_Aggr is if No (Expr) then return Lis; - elsif Nkind (Parent (Expr)) = N_Component_Association + elsif Nkind (Parent (Expr)) in N_Component_Association + | N_Iterated_Component_Association and then Present (Loop_Actions (Parent (Expr))) then Res := Loop_Actions (Parent (Expr)); @@ -1962,7 +1963,9 @@ package body Exp_Aggr is Bounds := Get_Index_Bounds (Choice); - if Low /= High then + if Low /= High + and then No (Loop_Actions (Assoc)) + then Set_Loop_Actions (Assoc, New_List); end if; @@ -2038,7 +2041,12 @@ package body Exp_Aggr is if First or else not Empty_Range (Low, High) then First := False; - Set_Loop_Actions (Others_Assoc, New_List); + if Present (Loop_Actions (Others_Assoc)) then + pragma Assert + (Is_Empty_List (Loop_Actions (Others_Assoc))); + else + Set_Loop_Actions (Others_Assoc, New_List); + end if; Expr := Get_Assoc_Expr (Others_Assoc); Append_List (Gen_Loop (Low, High, Expr), To => New_Code); end if; diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 656d789de73..087e324b5c1 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -2212,6 +2212,15 @@ package body Sem_Aggr is if Operating_Mode /= Check_Semantics then Remove_References (Expr); + declare + Loop_Action : Node_Id; + begin + Loop_Action := First (Loop_Actions (N)); + while Present (Loop_Action) loop + Remove_References (Loop_Action); + Next (Loop_Action); + end loop; + end; end if; -- An iterated_component_association may appear in a nested From patchwork Fri Aug 2 07:11:43 2024 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: 95181 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 93D5D385E44D for ; Fri, 2 Aug 2024 07:24:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id E786C385332C for ; Fri, 2 Aug 2024 07:12:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E786C385332C Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E786C385332C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::232 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582770; cv=none; b=Hq62XrE/OJZ9E3rnQC1TGiypnzFnQ3pGSbiH8i+MyrtySXSQ6Nm2LCj+n2pDXe/Iy4SgS8EZ8zojFZZe/8TaPJxlgnINwqsZhjMh2MVCYLoqSvz7DWLzll38pzF0+d+bfmsjFNMuOYtNi6QDSK29sYsPtu0vckHuIyC1dSGQGD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582770; c=relaxed/simple; bh=OvvHDjZuJG+Qh/x5IfCbeFwuoBeX8S88r9c+HQ1YhAg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fiK0VHv8rxBLzWfeNiUJ16fU0hhpDbm5URd0wYZ6+/Jvwi1wg+x/3t6ZaTvmu9iJYXXQDTheDoJKqj5oaVj8rW7MUxQTLpQxu2978WVMwUvItl4IWO/UBL4JI5DZcaHZpCVYMCS3AKNiOVAMC6OzYkVVB3gMFEOdSHrFnrA63Mw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2f025b94e07so100120581fa.0 for ; Fri, 02 Aug 2024 00:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582764; x=1723187564; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5Qd7iwud649++zbBWxgyaOQQd7JxYNbGuuTqe4ewhXc=; b=M1vepmzl/3sBPXaQ92xn4H5buVzYw8yCeNAHCZUg57sI8NF1GspwGLFl1WjpvKN7Mk 1ZBRuEDkYpdwwvV0Pf9Qj90Uu3MLz1FYlfE+syO7ocsXEnDRz0/zs0AEJuMwZ2P+rTkx laZE5wPd3d9+ahMdy0ty6e9OggwdIl5IdjD+6JSiSSJXs3zqhy8I6iy7asi3c06PFZjC tsxVHNdzMj09l11f5ZfuBst8jgBFfJH9wAGxjAQlPGx8c6ft9muOvDSvQ4+SYSPRbdJP sHJqTZQdYD5ToKg4muySMuydRBx9aMb4KlPaVJz4HWyzR3vfjVtAJiWQKfAk96oGN27O o27A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582764; x=1723187564; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5Qd7iwud649++zbBWxgyaOQQd7JxYNbGuuTqe4ewhXc=; b=MR5br6gCdCEqIZ9HdLIV3K0DSOg5qNH2y8hyD3uWeF2N6WnwO604EVRRE2EzPgdO2U YCBxSiWsDgra7wGjzDPQX8lyQmw1OReOhg7Y7GDAkWCbBG9AjoILp4WTi8JmfGETfUpv zQtyHVpJYIrBJp/KBQWvryMonK0DHim3k8D6zAb9AL7u0TLAyB2b0RN6eABrngHA3L41 lg23jG0vW1POvK6qn2vWbSfMWfY0+CnUELteqICSE6qr1+l3dGuj/A+5K809n5sJm4EW vwt6GgxD57mQbUmJhOMLRU8qr39ytmlj0IY4/Cx4/WnDZIcyN6kLibq9xJ8fIaKCYL6E DOAw== X-Gm-Message-State: AOJu0YxB/xk0TC31nvjlFVrlzcKXXMxuyETZ40VgrfBYt9ED5cbBKa4q DzBN7j8UeAiM2RreQQDIn2ERVECNfs0e0146eX+MvGXb3wRCsNV7JzqqZ8Fo4jRdjCzC11n3nCo ipA== X-Google-Smtp-Source: AGHT+IHfOv+M6Ekr8NOAi3ZT7ZwlJpLGq0N1zhUYN0n/ctl5WiO7MNYMpp76ptI8yrxq/w4Seld0ag== X-Received: by 2002:a05:6512:32c7:b0:52c:d76f:7f61 with SMTP id 2adb3069b0e04-530bb3a47f4mr1420669e87.56.1722582764211; Fri, 02 Aug 2024 00:12:44 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:43 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [COMMITTED 26/26] ada: Fix handling of SPARK_Mode on standalone child subprogram Date: Fri, 2 Aug 2024 09:11:43 +0200 Message-ID: <20240802071210.413366-26-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Yannick Moy SPARK_Mode aspect was not properly propagated to the body of a standalone child subprogram from the generated spec for that subprogram, leading GNATprove to not analyze this body. Now fixed. gcc/ada/ * aspects.adb (Find_Aspect): Take into account the case of a node of kind N_Defining_Program_Unit_Name. * sem_ch10.adb (Analyze_Compilation_Unit): Copy the SPARK aspect from the spec to the body. Delay semantic analysis after that point to ensure that SPARK_Mode is properly analyzed. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/aspects.adb | 8 +++++++- gcc/ada/sem_ch10.adb | 12 +++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb index b7262c56f3f..4c8ab7b4a33 100644 --- a/gcc/ada/aspects.adb +++ b/gcc/ada/aspects.adb @@ -190,13 +190,19 @@ package body Aspects is -- Note that not all aspects are added to the chain of representation -- items. In such cases, search the list of aspect specifications. First -- find the declaration node where the aspects reside. This is usually - -- the parent or the parent of the parent. + -- the parent or the parent of the parent, after getting through the + -- additional indirection of the N_Defining_Program_Unit_Name if needed. if No (Parent (Owner)) then return Empty; end if; Decl := Parent (Owner); + + if Nkind (Decl) = N_Defining_Program_Unit_Name then + Decl := Parent (Decl); + end if; + if not Permits_Aspect_Specifications (Decl) then Decl := Parent (Decl); diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 73e5388affd..e56fe30adae 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -1046,17 +1046,27 @@ package body Sem_Ch10 is Set_Library_Unit (N, Lib_Unit); Set_Parent_Spec (Unit (Lib_Unit), Cunit (Unum)); Make_Child_Decl_Unit (N); - Semantics (Lib_Unit); -- Now that a separate declaration exists, the body -- of the child unit does not act as spec any longer. Set_Acts_As_Spec (N, False); Move_Aspects (From => Unit_Node, To => Unit (Lib_Unit)); + + -- Ensure that the generated corresponding spec and + -- original body share the same SPARK_Mode pragma or + -- aspect. As a result, both have the same SPARK_Mode + -- attributes, and the global SPARK_Mode value is + -- correctly set for local subprograms. + + Copy_SPARK_Mode_Aspect (Unit (Lib_Unit), To => Unit_Node); + Set_Is_Child_Unit (Defining_Entity (Unit_Node)); Set_Debug_Info_Needed (Defining_Entity (Unit (Lib_Unit))); Set_Comes_From_Source_Default (SCS); + Semantics (Lib_Unit); + -- Restore Context_Items to the body Set_Context_Items (N, Context_Items (Lib_Unit));