From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 4776C385842E for ; Tue, 24 Oct 2023 09:49:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4776C385842E Authentication-Results: sourceware.org; dmarc=pass (p=none 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 4776C385842E 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=1698140971; cv=none; b=cE5cIYEwafAM/xxRQOE1MByLSHza/An5WaBCgOd7cCpldOOBRJuhmj1gEMlJjn8XDzUffOcSCKb/twWCBm/IIC46lFTdGQm7M8D77qLzQmWfqgnLpeRLdCVpqZaONKJAvJyS6MwS8qTdNdm8rM3aeQt+A6Ts8bAyRMOmgko6LaI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698140971; c=relaxed/simple; bh=V7Pq8933iLJvGH+7DcB9QX2TMhS06RjINUdrNqO8slw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=nE3cA/IQpSkzKZp16MAEnX4mH/TVTxGKvy9eoofMZfKHsRvXYvFQmGb8XkTeY1gQXK0jDa2cVXsyRqjN9ZBFwRjljOVVwL0N62KWPLCODb2xYs+IXc4eBx63DIXHikkgF/utm9ZyH+ZStGqqsh7PeN6sJqZt8yMu5+k5lVfO7qk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4084de32db5so36693045e9.0 for ; Tue, 24 Oct 2023 02:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1698140967; x=1698745767; darn=gcc.gnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=eLHiFSuYOhqk9UMORS+wbHMK3QU0T3TPznwMDBtUNcc=; b=PeEgGwuiCqb/pqX28HdnIHjvn9j6T6EggqkhUdoQbM9o1Mc6UmWXstxTwhbLO94Ct3 jjWy3NITz7AtI9QJzzPCRlvjphAjrLqwzMZxoqubCwAOdHGdVUlCuA5AnZt7vxEP3jGX ACNkFhvk5XVwIOaxEew7wD5FUUDY8MxCqpMh+R6BdP+/XTGzrC7PttNxH+zS60IohnTY xHRQmOYRevHqKKrDR2PkMHB5zkabQ8f18WYsL1Z5ekoxNwC+gGxUqej40KuVvAHvIgFv WF8jSuAOKReVeTUOzdZIN/3hHH5SaI/k/PcFBlve9TtDA346j+OqFDiX2+q7+T7PgDZy FzOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698140968; x=1698745768; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eLHiFSuYOhqk9UMORS+wbHMK3QU0T3TPznwMDBtUNcc=; b=NsFt+M2dkWiSkOZYsqfLzIVqn1Aav8Ov/89B5xDK4ddUhE33njgY3XWEAlOkHsMpg6 oK8TgnWe9H7GkHoIlbrvQ9Y0luLDdFypGl9MJEm2Btpp1+CjZeSFgRsZGBlugXZOoDQA 6jUok9oyXyRJpXdTmBTL0KGTUf0aEYgvbtRmwWKjRhUTwacizELsy8nPlw5kq0/lIn5N lr6AJTeZFV8czhmB5gjkg5j2871gGApp0SNKAikg6XISKAm/NhCSl2/3+o5ixPJHs5Xz TxgyKjMsO5hQkKjVzoteTyElcOqCfmoDznG1CJchK6RuvyukDd4xjCbAaOF5Q02XEB3D MtAw== X-Gm-Message-State: AOJu0YxYc8MfmlBACdWbxTZQrUwJ9v9LUH1mWRMCxi6oAohP/75bQhdQ aJMCdCQdspEDb1mE+D3LwTJhuA== X-Google-Smtp-Source: AGHT+IGkAUuNagx3G15fFLA0WYwM3EJTO4B1wbJs6ziCiSWeAPckbsR7p6bZsArdDYSLKcYT4rcXHA== X-Received: by 2002:a5d:6408:0:b0:32d:9572:6469 with SMTP id z8-20020a5d6408000000b0032d95726469mr8203848wru.46.1698140967441; Tue, 24 Oct 2023 02:49:27 -0700 (PDT) Received: from localhost ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id h2-20020a5d5042000000b0032d886039easm9554073wrt.14.2023.10.24.02.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 02:49:27 -0700 (PDT) Date: Tue, 24 Oct 2023 09:49:26 +0000 From: Arnaud Charlet To: Simon Wright Cc: gcc-patches@gcc.gnu.org, poulhies@adacore.com, squirek@adacore.com Subject: Re: [PATCH] Fix PR ada/111813 (Inconsistent limit in Ada.Calendar.Formatting) Message-ID: <20231024094926.GA4094122@adacore.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 List-Id: This change is OK, thank you. > The description of the second Value function (returning Duration) (ARM 9.6.1(87) > doesn't place any limitation on the Elapsed_Time parameter's value, beyond > "Constraint_Error is raised if the string is not formatted as described for Image, or > the function cannot interpret the given string as a Duration value". > > It would seem reasonable that Value and Image should be consistent, in that any > 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 > Elapsed_Time parameter should be less than 100.0 hours (the ARM merely says > that in that case the result is implementation-defined). > > The current implementation of Value raises Constraint_Error if the Elapsed_Time > parameter is greater than or equal to 24 hours. > > This patch removes the restriction, so that the Elapsed_Time parameter must only > be less than 100.0 hours. > > gcc/ada/Changelog: > > 2023-10-15 Simon Wright > > PR ada/111813 > > * 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). > > If an exception occurs of type Constraint_Error, re-raise it > rather than raising a new CE. > > gcc/testsuite/Changelog: > > 2023-10-15 Simon Wright > > PR ada/111813 > > * gcc/testsuite/gnat.dg/calendar_format_value.adb: New test.