From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14414 invoked by alias); 25 Apr 2012 07:51:03 -0000 Received: (qmail 14400 invoked by uid 22791); 25 Apr 2012 07:50:59 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-out.m-online.net (HELO mail-out.m-online.net) (212.18.0.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Apr 2012 07:50:39 +0000 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3Vctqx0cMqz4Kn91; Wed, 25 Apr 2012 09:50:36 +0200 (CEST) Received: from igel.home (ppp-88-217-111-104.dynamic.mnet-online.de [88.217.111.104]) by mail.mnet-online.de (Postfix) with ESMTPA id 3Vctqw4HVKz4KK9Q; Wed, 25 Apr 2012 09:50:36 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id D801FCA2A0; Wed, 25 Apr 2012 09:50:35 +0200 (CEST) From: Andreas Schwab To: "Maciej W. Rozycki" Cc: Tom Tromey , Sergio Durigan Junior , Jan Kratochvil , Subject: Re: Switch -Wunused-variable on? References: <20120422082240.GA21311@host2.jankratochvil.net> <87sjfufrlr.fsf@fleche.redhat.com> X-Yow: I have seen these EGG EXTENDERS in my Supermarket.. .. I have read the INSTRUCTIONS... Date: Wed, 25 Apr 2012 07:51:00 -0000 In-Reply-To: (Maciej W. Rozycki's message of "Tue, 24 Apr 2012 23:10:40 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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/msg00206.txt.bz2 "Maciej W. Rozycki" writes: > Instead write this: > > int target_frobnicate (int count); > > #ifdef TARGET_NEEDS_HARD_FROBNICATION > int target_frobnicate_harder (int count, int status); > #define target_needs_hard_frobnication 1 > #else > #define target_needs_hard_frobnication 0 > endif > > int > handle_frobnication (int count) > { > int status; > int i; > > status = target_frobnicate (count); > if (target_needs_hard_frobnication) > for (i = 0; i < count; i++) > status = target_frobnicate_harder (i, status); > > return status; > } > > -- "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. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."