From patchwork Tue Mar 5 10:52:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 224981 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]) by ozlabs.org (Postfix) with SMTP id 7B0382C0341 for ; Tue, 5 Mar 2013 21:52:23 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1363085544; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=fZcawExenRRO0E2hxyZB MK1ubJk=; b=qzQOFY5ZTLr7GbAx2Zg0zCd7HK6jzl20LMdQsOXwmBfZOQQ7Ppl9 YHP7bCyGZpi5Xj6SBepQVMukKXsrT+cTTFRCm0Qlxsi35YmN0Z03MUbabN31kXih KHNdkyoBKTJ7uP8kx49CAK0L2an59NnjTGNc5pPWqivaxW0ZoOB2vss= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=aPtedClmfwLCZWpBCli3wanqs9qbohm92zwdJQPAtOwk+ktheSNxIM7+VJOkwX m3HdQ1BvDEilnZf4T68bMyus6JfZvpdmLRdqE6ksVmILnjKJoNO4Pu1rioCI57DQ hHinARGT0k1uy38zy7nYME0/A3bgBdoIiDkSQsHUBxCI8=; Received: (qmail 15688 invoked by alias); 5 Mar 2013 10:52:17 -0000 Received: (qmail 15679 invoked by uid 22791); 5 Mar 2013 10:52:16 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Mar 2013 10:52:10 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r25Aq9h8018407 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 5 Mar 2013 05:52:09 -0500 Received: from zalov.cz (vpn1-7-229.ams2.redhat.com [10.36.7.229]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r25Aq76U002193 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Mar 2013 05:52:09 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.cz (8.14.5/8.14.5) with ESMTP id r25Aq7dk005930; Tue, 5 Mar 2013 11:52:07 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r25Aq6Ta005929; Tue, 5 Mar 2013 11:52:06 +0100 Date: Tue, 5 Mar 2013 11:52:05 +0100 From: Jakub Jelinek To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Silence up a false positive warning in libiberty (PR middle-end/56526) Message-ID: <20130305105205.GD12913@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 Hi! While wrapper_sect_offset is always initialized if (gnu_sections_found & SOMO_WRAPPING) != 0 and used only guarded with that same condition, as the PR says apparently we get a false positive maybe uninitialized warning for it still. I'd say it is a good programming style to just initialize such vars, especially in performance non-critical code. Ok for trunk? 2013-03-05 Jakub Jelinek PR middle-end/56526 * simple-object-mach-o.c (simple_object_mach_o_segment): Initialize wrapper_sect_offset to avoid a warning. Jakub --- libiberty/simple-object-mach-o.c.jj 2013-01-07 14:14:46.000000000 +0100 +++ libiberty/simple-object-mach-o.c 2013-03-05 11:46:19.574157009 +0100 @@ -432,7 +432,7 @@ simple_object_mach_o_segment (simple_obj size_t index_size; unsigned int n_wrapped_sects; size_t wrapper_sect_size; - off_t wrapper_sect_offset; + off_t wrapper_sect_offset = 0; fetch_32 = (omr->is_big_endian ? simple_object_fetch_big_32