From patchwork Thu Jul 31 12:28:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 375235 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 7B276140108 for ; Thu, 31 Jul 2014 22:29:03 +1000 (EST) 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=ml70Cls5OOZolBay/tSsfTdApR/dFiti6aX7UNvZD1j60lvOUe yWPIteoPVGDnfp8I/Vqy5iFiuyzMzmoGmUqWAS0N2QyGld5EckIiYWeOShm4Bx8D RGQQk/EoKpJaMZeOFlvU/fLPLj6eqZ/EJQUEIKrAk3qHW53XfePlqOW2E= 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=kKKMUcFLjXZ3FRQO501yRUJHUDM=; b=SKkxyyl3AbUvAan3vBGw 3+oLFktLg3IpVzdvGoJd0hWHf0EV7kb9nC+avxHsJExRMb6hRyIESlZ9ZL/+fJT8 t/cuxF2ZE5sCBgIs434HJA7lxn3Zk1oEkAvRsdd35CMAYYlEDdgMwCgnQdo9XtXp CtLBDPF4NoBs8D58CSioSJs= Received: (qmail 17787 invoked by alias); 31 Jul 2014 12:28:57 -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 17775 invoked by uid 89); 31 Jul 2014 12:28:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 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 (AES256-SHA encrypted) ESMTPS; Thu, 31 Jul 2014 12:28:55 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AFA7E116313; Thu, 31 Jul 2014 08:28:53 -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 bnD4lwujEbAR; Thu, 31 Jul 2014 08:28:53 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 9E1481161EE; Thu, 31 Jul 2014 08:28:53 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 97EFD3FE21; Thu, 31 Jul 2014 08:28:53 -0400 (EDT) Date: Thu, 31 Jul 2014 08:28:53 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vincent Celier Subject: [Ada] Avoid random warnings treated as errors Message-ID: <20140731122853.GA26594@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) There may be cases when warnings in the Project Manager are treated as errors, even when the switch -we is not used. There is no test, as the occurences of such errors are random (unitialized component of a record). Tested on x86_64-pc-linux-gnu, committed on trunk 2014-07-31 Vincent Celier * errutil.adb (Error_Msg): Make sure that all components of the error message object are initialized. Index: errutil.adb =================================================================== --- errutil.adb (revision 213326) +++ errutil.adb (working copy) @@ -201,24 +201,27 @@ -- Otherwise build error message object for new message - Errors.Increment_Last; - Cur_Msg := Errors.Last; - Errors.Table (Cur_Msg).Text := new String'(Msg_Buffer (1 .. Msglen)); - Errors.Table (Cur_Msg).Next := No_Error_Msg; - Errors.Table (Cur_Msg).Sptr := Sptr; - Errors.Table (Cur_Msg).Optr := Optr; - Errors.Table (Cur_Msg).Sfile := Get_Source_File_Index (Sptr); - Errors.Table (Cur_Msg).Line := Get_Physical_Line_Number (Sptr); - Errors.Table (Cur_Msg).Col := Get_Column_Number (Sptr); - Errors.Table (Cur_Msg).Style := Is_Style_Msg; - Errors.Table (Cur_Msg).Warn := Is_Warning_Msg; - Errors.Table (Cur_Msg).Info := Is_Info_Msg; - Errors.Table (Cur_Msg).Warn_Chr := Warning_Msg_Char; - Errors.Table (Cur_Msg).Serious := Is_Serious_Error; - Errors.Table (Cur_Msg).Uncond := Is_Unconditional_Msg; - Errors.Table (Cur_Msg).Msg_Cont := Continuation; - Errors.Table (Cur_Msg).Deleted := False; + Errors.Append + (New_Val => + (Text => new String'(Msg_Buffer (1 .. Msglen)), + Next => No_Error_Msg, + Prev => No_Error_Msg, + Sfile => Get_Source_File_Index (Sptr), + Sptr => Sptr, + Optr => Optr, + Line => Get_Physical_Line_Number (Sptr), + Col => Get_Column_Number (Sptr), + Warn => Is_Warning_Msg, + Info => Is_Info_Msg, + Warn_Err => Warning_Mode = Treat_As_Error, + Warn_Chr => Warning_Msg_Char, + Style => Is_Style_Msg, + Serious => Is_Serious_Error, + Uncond => Is_Unconditional_Msg, + Msg_Cont => Continuation, + Deleted => False)); + Cur_Msg := Errors.Last; Prev_Msg := No_Error_Msg; Next_Msg := First_Error_Msg;