From patchwork Fri Apr 28 13:47:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 756415 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wDwBm5q27z9s89 for ; Fri, 28 Apr 2017 23:48:32 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="e9HRGoUh"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=OhzL2f48UoGd9uE307JVrfAafm4fzndeXePmgljDWoJYGakPgZ TQ0+y3+YUsNruOziWKthcclSuTbLSC3ufXu+LBK/qCkrf1TyPfa8ezNXXZ7lc26+ jP0B2491ztLDbAFjqrKdgnEOSKYNcnengM9Ojv2UzIB87enOsJIZjgjO8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=1jFxLx8WO/vkYWBILJ/8V4HdC2M=; b=e9HRGoUh0ldI/9Ar3bxc nd6Ufk1M464qDYdGn2ipnRUObCkzITf5WG2kBBW6Guk4NmT9GYMNcNRo1VG1jxtN otLsUCFiSgMnFbtcSJYBmI6h9K2kDeokeoEygjqAgwMMiiKxvPhE+Kon1Mr0pAyH sbOvak+wD0P/PzPS9J/YD1w= Received: (qmail 69003 invoked by alias); 28 Apr 2017 13:47:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 68945 invoked by uid 89); 28 Apr 2017 13:47:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Alt X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Apr 2017 13:47:44 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AF04928F5A; Fri, 28 Apr 2017 09:47:45 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id UOob3OjjnggO; Fri, 28 Apr 2017 09:47:45 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id 9F2BB28F42; Fri, 28 Apr 2017 09:47:45 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4192) id 9E2523B2; Fri, 28 Apr 2017 09:47:45 -0400 (EDT) Date: Fri, 28 Apr 2017 09:47:45 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [Ada] Fix remaining warnings in compiler bootstrap #3 Message-ID: <20170428134745.GA82227@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) This fixes some of the remaining warnings that appear in a compiler bootstrap. The above ones are false positives of -Wmaybe-uninitialized and some are fixed by initializing the variable in case the control flow is complicated; the rest is fixed by just adding pragma Warnings. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-28 Eric Botcazou * exp_ch3.adb (Build_Init_Statements): Likewise on Nam. * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned. * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node. * sem_attr.adb (Loop_Entry): Initialize Encl_Loop. * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr. * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and Y_Size. * sem_eval.adb (Why_Not_Static): Initialize Typ. * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str. Index: sem_aggr.adb =================================================================== --- sem_aggr.adb (revision 247293) +++ sem_aggr.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2016, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2017, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -3205,7 +3205,7 @@ -- -- This variable is updated as a side effect of function Get_Value. - Box_Node : Node_Id; + Box_Node : Node_Id := Empty; Is_Box_Present : Boolean := False; Others_Box : Integer := 0; -- Ada 2005 (AI-287): Variables used in case of default initialization Index: sem_prag.adb =================================================================== --- sem_prag.adb (revision 247387) +++ sem_prag.adb (working copy) @@ -12667,6 +12667,7 @@ Eloc : Source_Ptr; Expr : Node_Id; Str : Node_Id; + pragma Warnings (Off, Str); begin -- Pragma Check is Ghost when it applies to a Ghost entity. Set Index: sem_ch12.adb =================================================================== --- sem_ch12.adb (revision 247387) +++ sem_ch12.adb (working copy) @@ -5652,6 +5652,7 @@ Decl : Node_Id; Expr : Node_Id; + pragma Warnings (Off, Expr); F1, F2 : Entity_Id; Func : Entity_Id; Op_Name : Name_Id; Index: freeze.adb =================================================================== --- freeze.adb (revision 247338) +++ freeze.adb (working copy) @@ -1174,6 +1174,7 @@ Component_Aliased : Boolean; Comp_Byte_Aligned : Boolean; + pragma Warnings (Off, Comp_Byte_Aligned); -- Set for the record case, True if Comp starts on a byte boundary -- (in which case it is allowed to have different storage order). Index: sem_attr.adb =================================================================== --- sem_attr.adb (revision 247383) +++ sem_attr.adb (working copy) @@ -4322,7 +4322,7 @@ Context : constant Node_Id := Parent (N); Attr : Node_Id; - Encl_Loop : Node_Id; + Encl_Loop : Node_Id := Empty; Encl_Prag : Node_Id := Empty; Loop_Id : Entity_Id := Empty; Scop : Entity_Id; Index: sem_eval.adb =================================================================== --- sem_eval.adb (revision 247333) +++ sem_eval.adb (working copy) @@ -6457,8 +6457,8 @@ -------------------- procedure Why_Not_Static (Expr : Node_Id) is - N : constant Node_Id := Original_Node (Expr); - Typ : Entity_Id; + N : constant Node_Id := Original_Node (Expr); + Typ : Entity_Id := Empty; E : Entity_Id; Alt : Node_Id; Exp : Node_Id; Index: sem_ch13.adb =================================================================== --- sem_ch13.adb (revision 247387) +++ sem_ch13.adb (working copy) @@ -13334,10 +13334,10 @@ Expr : Node_Id; X_Alignment : Uint; - Y_Alignment : Uint; + Y_Alignment : Uint := Uint_0; X_Size : Uint; - Y_Size : Uint; + Y_Size : Uint := Uint_0; X_Offs : Uint; Index: exp_ch3.adb =================================================================== --- exp_ch3.adb (revision 247320) +++ exp_ch3.adb (working copy) @@ -2875,6 +2875,7 @@ declare Exp : Node_Id; Nam : Name_Id; + pragma Warnings (Off, Nam); Ritem : Node_Id; begin