From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78168 invoked by alias); 5 Oct 2018 05:08:14 -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 78144 invoked by uid 89); 5 Oct 2018 05:08:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=U*palves, sk:palves@, palvesredhatcom, sk:palves X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.154) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 05 Oct 2018 05:08:12 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 3F1FA400C48E1 for ; Fri, 5 Oct 2018 00:08:11 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 8ILTgnS9f8YaU8ILTgG1ce; Fri, 05 Oct 2018 00:08:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OostuciDa85BKMRMkX8vSVF0ah+HRxjBR0vQVx5R7Gk=; b=blwWtE7kUYc/KUYbNarSZ3cL/t VYZes9ioCokpVbsr9Yc1eSlupn80XYb0dp7xgehVXPLv+D3Mz1GwNiI4tVfpti7sB286D0zqTuiT3 2JyN9R5m9diDpxWv0byZqw84D; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:41802 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1g8ILS-002WwO-UN; Fri, 05 Oct 2018 00:08:11 -0500 From: Tom Tromey To: Pedro Alves Cc: Simon Marchi , asmwarrior , GDB Development Subject: Re: gcc warning with "some variable may be used uninitialized in this function [-Wmaybe-uninitialized]" when building under msys References: <46b498a8-ba44-3f67-783d-85cd5ac8f0c9@gmail.com> <9aa0ec3d6356d1e0c746697161918576@polymtl.ca> <8305e255-1621-96a7-cf06-3cd1cd27ceae@redhat.com> Date: Fri, 05 Oct 2018 05:08:00 -0000 In-Reply-To: <8305e255-1621-96a7-cf06-3cd1cd27ceae@redhat.com> (Pedro Alves's message of "Thu, 4 Oct 2018 13:39:55 +0100") Message-ID: <87d0spf0au.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-10/txt/msg00006.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> If the warnings confuse people too much, I'd be OK with Pedro> disabling -Wmaybe-uninitlized completely. I left it as a Pedro> -Wno-error warning because even though it produces false positives, Pedro> it also helps catch bugs earlier in the compile-edit cycle, Pedro> when you're hacking some code, when you're introducing Pedro> uninitialized uses, and "make" ends up compiling just a few Pedro> files. It caught a bug in the -Wshadow=local series; and I think in most cases the false reports are easily handled with an initialization. I suppose in theory these initializations could themselves mask bugs, but I don't recall that ever actually happening (or at least being noticed). It would be good if gcc could recognize std::optional and not issue the warning when it is used. Perhaps gdb could then just always use optional for the maybe-not-initialized cases. Tom