From patchwork Tue May 17 08:27:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 54081 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 DBF05385735A for ; Tue, 17 May 2022 08:48:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DBF05385735A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652777319; bh=VmnZlM2HgtVh0jQMsd8hOgRPaLmaXaED0H0AtOYHGCQ=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=KgSg3Z4BIOjL3///qdmMAq3eO3q4idnN2a+Ka62xpZBDFB68vx1xb17A1SFmHqDbv lQTM/le5Vnj7wYNP6Q7lIh5im9Opr9rcCNpHjSrXDkPsMHqQMJpPfFSGb5cDigQId3 /uPuvTDGmr9a7+PKR3UaBLV90PBwcmdJ47wUt6Gs= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 780A53857C50 for ; Tue, 17 May 2022 08:27:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 780A53857C50 Received: by mail-wm1-x329.google.com with SMTP id k26so2210172wms.1 for ; Tue, 17 May 2022 01:27:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=VmnZlM2HgtVh0jQMsd8hOgRPaLmaXaED0H0AtOYHGCQ=; b=4aemcEfGWasfO2v7QBfAGITcnFjQlbKYfLSfDyKtWYRMAxnJsyoC5H8oFcV8w4Sf5W BSwJ3oVAAXqdb08OkXII9gj7bE+UvFv/sVy3FLyzDTeC4cQk1Gg/WRndbfchpkSeXxKJ xL7UaskauOnKPIQrFkbaIoY6BRmD+qiHUZKCn5/iMT9UKfik3nOOFHRjsTfO2zPnhOT7 PcE5R1GiTPXTnzYq5VEvmvPJZZeq4teLTOM5WsbLT5704PXc+jIGg1q7z1Xt9IwxRbnU hwdd1sAPgb+tBAfDj88wWsf6OqgKzSXEamsiE2CzOegdZT017FJDEms/KXepLRAgQPfB obDw== X-Gm-Message-State: AOAM533CdyjNt5+mKyDsLviNKFjJr9cG+h3/opbI8+0N0Gxk07oV1Yg9 QWtzjpBKbJI0KeAyRmrdGH411G2jVvjCuGY9 X-Google-Smtp-Source: ABdhPJzBt9Oc6O0nrQ5Dohbw+yQ0y3C0VWAEGHQv0kxUyx/Ha8/Bb15Ig3cd1SkrXZAPBCriXGd25Q== X-Received: by 2002:a05:600c:1d9f:b0:394:7a51:cb8b with SMTP id p31-20020a05600c1d9f00b003947a51cb8bmr20463121wms.163.1652776069229; Tue, 17 May 2022 01:27:49 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id q1-20020adf9dc1000000b0020e5b4ebaecsm317649wre.4.2022.05.17.01.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 01:27:48 -0700 (PDT) Date: Tue, 17 May 2022 08:27:48 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Fix Forced sign flag in formatted string Message-ID: <20220517082748.GA1090035@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.2 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, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Pierre-Marie de Rodat via Gcc-patches From: Pierre-Marie de Rodat Reply-To: Pierre-Marie de Rodat Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Fix the Forced sign flag that is incorrectly ignored for scientific notation and shortest representation. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/g-forstr.adb (Is_Number): Add scientific notation and shortest representation. diff --git a/gcc/ada/libgnat/g-forstr.adb b/gcc/ada/libgnat/g-forstr.adb --- a/gcc/ada/libgnat/g-forstr.adb +++ b/gcc/ada/libgnat/g-forstr.adb @@ -58,7 +58,7 @@ package body GNAT.Formatted_String is type Sign_Kind is (Neg, Zero, Pos); - subtype Is_Number is F_Kind range Decimal_Int .. Decimal_Float; + subtype Is_Number is F_Kind range Decimal_Int .. Shortest_Decimal_Float_Up; type F_Sign is (If_Neg, Forced, Space) with Default_Value => If_Neg;