From patchwork Mon May 15 09:42:49 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: 94044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6792978vqo; Mon, 15 May 2023 02:50:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5VJscw+nzuggSXh0LCxRKgYyzBP24uOXA+QJA7DN6KKYLAlY5r/NSqYq7S5Rs+/MGJX0rv X-Received: by 2002:aa7:c254:0:b0:506:8838:45cc with SMTP id y20-20020aa7c254000000b00506883845ccmr24363387edo.6.1684144222898; Mon, 15 May 2023 02:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684144222; cv=none; d=google.com; s=arc-20160816; b=M1Rt4KUOPMk2kVj5DjppIsXCaAmXPj7vbnQcAB1pAPbKbggJJz+VJ99/+bkREoxGUM 5obXI/OCyypAIVGZ3T9uaQQSx8jy/O5I/MaUBGIpG/7jACfeReYe6S9V1B2D0Joq4//z erpdjiQe62HG13ymBqom/j1xs6Wn9oaybFK/hmfUldHoQ8h8jLb2A2hmELAjV65dNw/m pA2LUYujAIP6hznSGkYITzJzBEqu81lNdQ/1tFUkXjfse9xpgklBcgIhZgx/3ZWiORqz xx3NP3X/YTSzpL3oInSOwE041m/gsEVB4OA3pbRfxWO7pGzH/HaxeQm7+KBTe3z+TNJN 5iGw== 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=ltuFn6b3HA25qI91DC7rAYYuaGp92hRe8oBmx5rQLpE=; b=tdUdcgKtF7YwYeAImYBSHoegDzPOp+cKQ98RlrAFC9Akmc6YjMl+Pma209Ij38/IHm GqiBhKd6j7yDcaK7v7zmraaiAavRmFXiLlbkscxOOM7x29EBDYolnWwzVrfo2YJoDHWD HouULbLbur4j0BqvKrk8QDoqY7ORbPhjyqHHyNlLxWzGtp9W0TO9GVJooFwkMaKLZWR4 FP5WwSNuOWfJTM46FG0mGEAtuw76C7DmWsHt47zKBNLONgIbGmxOWuoywNf+EavBEeDn fRHXCidBWioUfCcAeYOgLIXbREcILsSqp7XGQIBhLN04mHlZzqE9jhZWf70pfUmemGFc NVEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=JHE+Okdo; 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 sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id r10-20020a056402034a00b0050bf6548840si12228222edw.590.2023.05.15.02.50.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 02:50: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=JHE+Okdo; 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 76FA9388B6AB for ; Mon, 15 May 2023 09:46:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76FA9388B6AB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684143986; bh=ltuFn6b3HA25qI91DC7rAYYuaGp92hRe8oBmx5rQLpE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=JHE+OkdoN7Hz+OQBrJWG1lrbvGWnm67Rlv/NnB5gHq/YUs7Effi+ACpOOsesaC4Gu vK2vDjaMnKsI9WX0MU6F5Kh7vrxANdTPS29b+9ZPnrCKuJHeBxFJ59g2xkWbpQVsyX +BUcSjBItlDZM8VEyY+TscdtquDAlrQ3xwZ9hKZQ= 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 544873853816 for ; Mon, 15 May 2023 09:42:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 544873853816 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-306f2b42a86so8166687f8f.3 for ; Mon, 15 May 2023 02:42:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684143772; x=1686735772; 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=ltuFn6b3HA25qI91DC7rAYYuaGp92hRe8oBmx5rQLpE=; b=Ggr4SwtuhCjCNbaG4yzR+73LlUP+O3bXA9t4jpIjVjbT/cQi44jpMkWyYgAnaYyqQo 18DQjfLojtfRTtaTwyILwziqQtU3z4RCYLrm1/xkw4+BSBr8OMiCOFoYBuSpOxYsAC3P YeV6JemSxuEOyLh2pwDftXUXN0W9OM6BW+vgC/wbDbpm+f1kTMwLiPAYk8tr1tLTR9L4 tnHmWrNQKRUBH7wxhLgbwzXIsYVDF+RA7LdxhlFS2cT0zPbgRhIwBSiP6eeLGG+xqPVk 7CQx5lYO5hBoYQEqEkkk7LQYqsKCzRbwBaPBpNBx+VAdSlDwDtN6lOVEzKSyzTscmQLO t4XQ== X-Gm-Message-State: AC+VfDwT4hjZ1bagHAXwwjfTSKjk8HjSJjHlPeLuDT1eIOWNLJ9iQIH1 JXjCYAqjtX+CQXek8z4hSxBJIxNA343NqKjiS2o+Yw== X-Received: by 2002:adf:e84e:0:b0:306:35fa:202b with SMTP id d14-20020adfe84e000000b0030635fa202bmr21370091wrn.6.1684143772118; Mon, 15 May 2023 02:42:52 -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 o17-20020a5d4091000000b003078a3f3a24sm28181508wrp.114.2023.05.15.02.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 02:42:51 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [COMMITTED] ada: Fix handling of pragma Warnings (Toolname, Off/On) Date: Mon, 15 May 2023 11:42:49 +0200 Message-Id: <20230515094249.1407836-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 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, 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765953212648107606?= X-GMAIL-MSGID: =?utf-8?q?1765953212648107606?= From: Yannick Moy Pragma Warnings On/Off with a preceding toolname (which could be GNAT or GNATprove) was ignored due an error in accessing the expression of a pragma association in the parser. Now fixed. gcc/ada/ * par-prag.adb (First_Arg_Is_Matching_Tool_Name): Fix access to expression in pragma association. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/par-prag.adb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index 3a9764adec3..e78f97d11fb 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -1150,13 +1150,14 @@ begin ------------------------------------- function First_Arg_Is_Matching_Tool_Name return Boolean is + Expr : constant Node_Id := Get_Pragma_Arg (Arg1); begin - return Nkind (Arg1) = N_Identifier + return Nkind (Expr) = N_Identifier -- Return True if the tool name is GNAT, and we're not in -- GNATprove or CodePeer mode... - and then ((Chars (Arg1) = Name_Gnat + and then ((Chars (Expr) = Name_Gnat and then not (CodePeer_Mode or GNATprove_Mode)) @@ -1164,7 +1165,7 @@ begin -- mode. or else - (Chars (Arg1) = Name_Gnatprove + (Chars (Expr) = Name_Gnatprove and then GNATprove_Mode)); end First_Arg_Is_Matching_Tool_Name; @@ -1189,7 +1190,7 @@ begin -------------- function Last_Arg return Node_Id is - Last_Arg : Node_Id; + Last_Arg : Node_Id; begin if Arg_Count = 1 then