From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12922 invoked by alias); 25 Apr 2012 15:57:32 -0000 Received: (qmail 12912 invoked by uid 22791); 25 Apr 2012 15:57:30 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Apr 2012 15:57:13 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SN4ac-0004Ba-Vm from Maciej_Rozycki@mentor.com ; Wed, 25 Apr 2012 08:57:11 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 25 Apr 2012 08:57:10 -0700 Received: from [172.30.0.84] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Wed, 25 Apr 2012 16:57:07 +0100 Date: Wed, 25 Apr 2012 15:57:00 -0000 From: "Maciej W. Rozycki" To: Andreas Schwab CC: Tom Tromey , Sergio Durigan Junior , Jan Kratochvil , Subject: Re: Switch -Wunused-variable on? In-Reply-To: Message-ID: References: <20120422082240.GA21311@host2.jankratochvil.net> <87sjfufrlr.fsf@fleche.redhat.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" 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/msg00212.txt.bz2 On Wed, 25 Apr 2012, Andreas Schwab wrote: > > -- "i" is now live in all cases and also IMHO handle_frobnication is more > > readable. > > It also requires an unconditional declaration and definition of > target_frobnicate_harder. Yes, but do you see at as advantage or disadvantage? Please note that my example can be easily adapted to a three-way choice where the value of target_frobnicate_harder can only be determined at the run time, e.g.: #ifdef TARGET_NEEDS_HARD_FROBNICATION #define target_needs_hard_frobnication 1 #else if defined TARGET_SUPPORTS_HARD_FROBNICATION int target_needs_hard_frobnication; #else #define target_needs_hard_frobnication 0 endif and then you still have all the conditional bits localised here and don't have to modify handle_frobnication at at all. :) Maciej