From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35457 invoked by alias); 4 Oct 2018 12:01:36 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 35054 invoked by uid 89); 4 Oct 2018 12:01:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*gdb X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Oct 2018 12:01:13 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w94C0u2r025533 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 4 Oct 2018 08:01:01 -0400 Received: by simark.ca (Postfix, from userid 112) id 505451E9A1; Thu, 4 Oct 2018 08:00:56 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 924541E50E; Thu, 4 Oct 2018 08:00:54 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 04 Oct 2018 12:01:00 -0000 From: Simon Marchi To: asmwarrior Cc: GDB Development Subject: Re: gcc warning with "some variable may be used uninitialized in this function [-Wmaybe-uninitialized]" when building under msys In-Reply-To: <46b498a8-ba44-3f67-783d-85cd5ac8f0c9@gmail.com> References: <46b498a8-ba44-3f67-783d-85cd5ac8f0c9@gmail.com> Message-ID: <9aa0ec3d6356d1e0c746697161918576@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00001.txt.bz2 On 2018-10-04 02:28, asmwarrior wrote: > Hi, when building gdb git head(which is > 875e539851bb2702f3292f819e220545a8776242 as 2018-10-04) under msys+gcc > 5.4, I see such warning: > > CXX infrun.o > In file included from ../../binutils-gdb/gdb/inferior.h:49:0, > from ../../binutils-gdb/gdb/infrun.c:26: > ../../binutils-gdb/gdb/progspace.h: In function 'void > handle_vfork_child_exec_or_exit(int)': > ../../binutils-gdb/gdb/progspace.h:285:47: warning: '*((void*)(& > maybe_restore_inferior)+16).scoped_restore_current_program_space::m_saved_pspace' > may be used uninitialized in this function [-Wmaybe-uninitialized] > { set_current_program_space (m_saved_pspace); } > ^ > ../../binutils-gdb/gdb/infrun.c:931:6: note: '*((void*)(& > maybe_restore_inferior)+16).scoped_restore_current_program_space::m_saved_pspace' > was declared here > maybe_restore_inferior; > ^ > CXX inline-frame.o > > Hope you devs can fix this. Thanks. > > Asmwarrior I also see this from time to time. I think it is a false positive, but I may be wrong. Do you see a code path that could actually be problematic? Simon