From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11760 invoked by alias); 9 May 2010 09:14:09 -0000 Received: (qmail 11749 invoked by uid 22791); 9 May 2010 09:14:08 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 09 May 2010 09:14:03 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 96CFC2BABAA; Sun, 9 May 2010 05:14:01 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id iWRo4RezQ7b6; Sun, 9 May 2010 05:14:01 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 15D0D2BABA0; Sun, 9 May 2010 05:14:01 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 76D70F58F9; Sun, 9 May 2010 02:13:53 -0700 (PDT) Date: Sun, 09 May 2010 09:14:00 -0000 From: Joel Brobecker To: Jan Kratochvil Cc: Michael Snyder , "gdb-patches@sourceware.org" Subject: Re: [patch] serial, mdebugread, top.c, utils, frame.c: remove unused variables Message-ID: <20100509091353.GB7479@adacore.com> References: <4BE363CE.2000807@vmware.com> <20100508211155.GA12079@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100508211155.GA12079@host0.dyn.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00220.txt.bz2 > > static void > > do_fclose_cleanup (void *arg) > > { > > - FILE *file = arg; > > fclose (arg); > > } > > I believe the intentional was rather `fclose (file);' according to the general > GDB template of callback functions: Good catch, Jan. > void > func (void *arg) > { > real_type *var = arg; > > Use VAR having it type-checked callee prototypes or real_type changes. > } > > But I understand it is a nitpick for never-changing FILE * and fclose. I think it's still important that we follow that paradigm (IMO). It makes the code clearer. -- Joel