From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11032 invoked by alias); 23 Apr 2012 08:55:27 -0000 Received: (qmail 11011 invoked by uid 22791); 23 Apr 2012 08:55:25 -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; Mon, 23 Apr 2012 08:55:10 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3N8t9wS030818 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Apr 2012 04:55:09 -0400 Received: from host2.jankratochvil.net (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q3N8t50v001768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 23 Apr 2012 04:55:08 -0400 Date: Mon, 23 Apr 2012 08:55:00 -0000 From: Jan Kratochvil To: Jeffrey Walton Cc: Sergio Durigan Junior , gdb@sourceware.org Subject: Re: Switch -Wunused-variable on? Message-ID: <20120423085504.GA562@host2.jankratochvil.net> References: <20120422082240.GA21311@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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/msg00181.txt.bz2 On Mon, 23 Apr 2012 00:25:36 +0200, Jeffrey Walton wrote: > On Sun, Apr 22, 2012 at 4:24 PM, Sergio Durigan Junior wrote: > > 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, I would find right to properly #if-compile even the variable declaration but I do not have real experience how complicated it may be. > > #define USED_VAR(var) ((void) var) > > I use this technique when using -Wall. It even works on Visual Studio, > so the technique is portable. Sourceware is using ATTRIBUTE_UNUSED. Thanks, Jan