From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.hosts.co.uk (smtp.hosts.co.uk [85.233.160.19]) by sourceware.org (Postfix) with ESMTPS id DD7983858C41 for ; Thu, 9 Nov 2023 11:22:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DD7983858C41 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=pushface.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=pushface.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DD7983858C41 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=85.233.160.19 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699528956; cv=none; b=ULXTyz66Jt2ARywFNGDeM7Qe2ySRjj270BBDUm/Ix2NS4LBAtgA3+sb3ggBD7jgMWZgZtqErf3ZpuGQiBZooxzt61RIwq1jA2TL91DcTCLeCta9UId9uhZJtui2GMwEiunQ1aEKV2oLDYxozBF8ucbpjzYCNZntnwn9zVmyO3ww= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699528956; c=relaxed/simple; bh=JoeHHDh3eUjpDbxGCJe/AA/ZbnNpjiBi9Hun5NvJfTk=; h=Mime-Version:Subject:From:Date:Message-Id:To; b=uKHyAXlYWw62AffSmtlO/C4QIOLGzMUZxKhJzSsLpa9IDO4d5GBZnFkWl4Q4tdwC2p9/7jyKhY4Hn1PXGJd7nf9fiKmGu86kkpsmDVQmc5VmliBmCE6yqy7Qvu9yWZG+wFeawzdS1WmkCbwmyL1qoaap41kTmusVDCFzbdTEklI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from host-80-43-120-208.as13285.net ([80.43.120.208] helo=smtpclient.apple) by smtp.hosts.co.uk with esmtpa (Exim) (envelope-from ) id 1r137I-0006yN-87; Thu, 09 Nov 2023 11:22:32 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Subject: Re: [PATCH] Fix PR ada/111813 (Inconsistent limit in Ada.Calendar.Formatting) From: Simon Wright In-Reply-To: <20231024094926.GA4094122@adacore.com> Date: Thu, 9 Nov 2023 11:22:21 +0000 Cc: gcc-patches@gcc.gnu.org, poulhies@adacore.com, squirek@adacore.com Content-Transfer-Encoding: quoted-printable Message-Id: <6FC216D2-458D-4A0A-85D7-2C309D5BBBF8@pushface.org> References: <20231024094926.GA4094122@adacore.com> To: Arnaud Charlet X-Mailer: Apple Mail (2.3774.200.91.1.1) X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 24 Oct 2023, at 10:49, Arnaud Charlet wrote: >=20 > This change is OK, thank you. Can it be committed, then, please? >> The description of the second Value function (returning Duration) = (ARM 9.6.1(87)=20 >> doesn't place any limitation on the Elapsed_Time parameter's value, = beyond=20 >> "Constraint_Error is raised if the string is not formatted as = described for Image, or=20 >> the function cannot interpret the given string as a Duration value". >>=20 >> It would seem reasonable that Value and Image should be consistent, = in that any=20 >> string produced by Image should be accepted by Value. Since Image = must produce >> a two-digit representation of the Hours, there's an implication that = its=20 >> Elapsed_Time parameter should be less than 100.0 hours (the ARM = merely says >> that in that case the result is implementation-defined). >>=20 >> The current implementation of Value raises Constraint_Error if the = Elapsed_Time >> parameter is greater than or equal to 24 hours. >>=20 >> This patch removes the restriction, so that the Elapsed_Time = parameter must only >> be less than 100.0 hours. >>=20 >> gcc/ada/Changelog: >>=20 >> 2023-10-15 Simon Wright >>=20 >> PR ada/111813 >>=20 >> * gcc/ada/libgnat/a-calfor.adb (Value (2)): Allow values of = parameter >> Elapsed_Time greater than or equal to 24 hours, by doing the >> hour calculations in Natural rather than Hour_Number (0 .. 23). >> Calculate the result directly rather than by using Seconds_Of >> (whose Hour parameter is of type Hour_Number). >>=20 >> If an exception occurs of type Constraint_Error, re-raise it >> rather than raising a new CE. >>=20 >> gcc/testsuite/Changelog: >>=20 >> 2023-10-15 Simon Wright >>=20 >> PR ada/111813 >>=20 >> * gcc/testsuite/gnat.dg/calendar_format_value.adb: New test.