From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25659 invoked by alias); 22 Apr 2012 20:25:02 -0000 Received: (qmail 25601 invoked by uid 22791); 22 Apr 2012 20:25:01 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Sun, 22 Apr 2012 20:24:40 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3MKOeFi013214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 22 Apr 2012 16:24:40 -0400 Received: from psique ([10.3.112.7]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3MKOYXh011564; Sun, 22 Apr 2012 16:24:37 -0400 From: Sergio Durigan Junior To: Jan Kratochvil Cc: gdb@sourceware.org Subject: Re: Switch -Wunused-variable on? References: <20120422082240.GA21311@host2.jankratochvil.net> X-URL: http://www.redhat.com Date: Sun, 22 Apr 2012 20:25:00 -0000 In-Reply-To: <20120422082240.GA21311@host2.jankratochvil.net> (Jan Kratochvil's message of "Sun, 22 Apr 2012 10:22:40 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes 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 X-SW-Source: 2012-04/txt/msg00176.txt.bz2 On Sunday, April 22 2012, Jan Kratochvil wrote: > On Sun, 22 Apr 2012 09:14:44 +0200, Sergio Durigan Junior wrote: >> However, before continuing to prepare this patch, I would like what you >> think about enabling -Wunused-variable by default in the building. > > There are more useful -Wunused* options, GDB uses now: > -Wno-unused -Wunused-value -Wunused-function Sorry, do you mean that there are more useful -Wunused* flags than -Wunused-variable? > IIRC the counterargument for -Wunused-variable was that GDB contains various > #if-compiled code where is a nightmare to get the code right with matching > #if-clauses also for the variables being used by various #if-compiled code > chunks. I could not find that mail now in the time I gave to it. Yes, this is a counter-argument, and I was also thinking about it. I don't know how people prefer to deal with this issue, but something like: #define USED_VAR(var) ((void) var) Would be OK? > I believe more -Wunused* would be worth it, maybe the mail was before Joel > started to disable -Werror for releases so that claim about problematic > #if-clauses is no longer valid. Yes, I believe the more useful warnings we have, the better. Thanks, -- Sergio