From patchwork Tue Jul 18 13:13:23 2023 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: 122010 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1736945vqt; Tue, 18 Jul 2023 06:15:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlGua1BEIBabSAapQOhA/Ie3BOHhQSzBSyzUzWHY87GVuyaN9BGgY430X08aq1ERW/MZcpSC X-Received: by 2002:a17:907:b0a:b0:993:6382:6e34 with SMTP id h10-20020a1709070b0a00b0099363826e34mr11184567ejl.72.1689686122313; Tue, 18 Jul 2023 06:15:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689686122; cv=none; d=google.com; s=arc-20160816; b=AIpJYBhOvWYjgx4Mg2jpKObk7JE8txnPQ+hQ3yxU1wXJOWmCffuP6jNEH6xrFOKLwG Q2W6btMN7RhgFWqK5AeEhny3b3DpTTIoIem9j/oWV5ebY0ahxtEBmjH9zwQ1rFXw96ho P4SqXo1kaA7sd8eDbK9EEx15lgRWQCVRcBgGLljJgtIDoCDraiNmsLx3F6YwwrfwAmHs OosSSVF8Iq8CGcQPgBoo1ybPi8s7BJsSmF7eEA8f3I660WKzi0s21W9I9u7wDwRUq4bp ikR2sS3x9aYsPf+7Kx+fJwtuXcn73PiMFU7bls9VTTYq9JvsMDbPxgyhcxAqE2S7S65k E8CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=LwrXGAMQjhNiFlJCXIqd9ZaM9HMn/MQ4f/14N0+rjo0=; fh=w572rugJMIM9+pZk8ebHF/s1o7vrKucaE4Is50F1zMM=; b=Ta/7yXBhC2ZD5d7Ro4FRzAhB8pB4DHJKXAhFDsOIiaZ4a3awgwXMvdn5nbfxcAT8jP kXo8q8s1h49QdsHlrO0AJd5XGWcVb0+4a77fxs/R39tmjkFWA01aiHjgx6/aNgOIR9J7 IeMJdJQzX/Shp0L/8cxIHx8Dm3zmbF0RbIvcg4xUnNn+pZWhN8ETbNyX6G0RkFMtQZa4 rNIxWYPN54RFO+uks1QjGLpYH5QVx7a32RDwMeQugXHqnx/ITrkCXrC1J7rQN2yc1Tth Lipa5T+GhIF9BJxtA4x2jY9vFnK7LjWmCN1GXoI8oCe4nA1zAOqcgHrzbzpsmMP4fxWT 6H0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ou9cJGHy; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id l14-20020a1709067d4e00b00992ac0466e2si1082021ejp.653.2023.07.18.06.15.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 06:15:22 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ou9cJGHy; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BD4D33850212 for ; Tue, 18 Jul 2023 13:14:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD4D33850212 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689686054; bh=LwrXGAMQjhNiFlJCXIqd9ZaM9HMn/MQ4f/14N0+rjo0=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ou9cJGHy/XID5DP/XKei/NPOrjtYs0ghqcn5J2lBmV/dIu8zy8+MQtXO6F0BauXCg IyqemEQ6s3waE17gANoss0y0rWPSfKaf3sLlyaGSUuq+Q3m9+lwvTkuBKn1xxKcJXz BsqpckHwibQjBe06s12qB2QxsZXAUf5mWTyuaZSE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 8200C385773C for ; Tue, 18 Jul 2023 13:13:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8200C385773C Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3143b88faebso6039787f8f.3 for ; Tue, 18 Jul 2023 06:13:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689686005; x=1690290805; 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=LwrXGAMQjhNiFlJCXIqd9ZaM9HMn/MQ4f/14N0+rjo0=; b=dfpYXTbsHpK0gULPnJPEV62iB5sUOnyzxe5+4s3/l24+8nn2HA6qgJHGSQZU48mLOJ 2DsCAwwrOyQOOdhu8M6DWTnBI3IkUnXbWyn50E0FPyG4I850OgWOH3T6m4jHAmerTERe t091syIbw2TLoYTeeIRUGTvYdRQAXlr4l5LPS8dMz4EsI/N5VBXwSVR+RGpcsdYN0/7s aDhjWNvMzaAeBkn7u6dW3XNWsKFyhEVgDXpGTrSo+urJJn0xruEkYRTbHC1VaF/Jcilt zAc/7+5gtMa24nqNBjljxGqYXVF2XQKlwYFe/BhgXiA1q7xhXLNXmuBJuhWD2TQwebzQ bX7Q== X-Gm-Message-State: ABy/qLaCc7kEhcHimE5cOTRx/s/kkUUgzRM89el0DiY/BH6tvB2JwT9P +HrZcrI50KqDbR6SoMR0W7VkDD3ZgOr2FDHvsbg5fQ== X-Received: by 2002:adf:f78a:0:b0:313:f371:aede with SMTP id q10-20020adff78a000000b00313f371aedemr12520108wrp.1.1689686005005; Tue, 18 Jul 2023 06:13:25 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id v12-20020adfedcc000000b00314315071bbsm2402028wro.38.2023.07.18.06.13.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 06:13:24 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [COMMITTED] ada: Allow warnings with explain code Date: Tue, 18 Jul 2023 15:13:23 +0200 Message-Id: <20230718131323.80823-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 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, 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: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771764315475409936 X-GMAIL-MSGID: 1771764315475409936 From: Yannick Moy Change the way explain codes are handled to generate the command for the user to get the explanations, as this was not working for warnings. gcc/ada/ * errout.adb (Error_Msg_Internal): Remove call to Prescan_Message on the special continuation for the explain code command, as this does not play well with the setting of global variables for the message (like its status as a warning or not). Instead, set directly the global variables regarding content of the message in terms of special characters. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/errout.adb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index adc260843ec..ac6491cf299 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -1451,10 +1451,12 @@ package body Errout is if Has_Error_Code then declare Msg : constant String := - "launch ""gnatprove --explain=[]"" for more information"; + "\launch ""gnatprove --explain=[]"" for more information"; begin - Prescan_Message (Msg); + Has_Double_Exclam := False; Has_Error_Code := False; + Has_Insertion_Line := False; + Error_Msg_Internal (Msg => Msg, Span => Span,