From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32290 invoked by alias); 23 Apr 2010 18:09:46 -0000 Received: (qmail 32244 invoked by uid 22791); 23 Apr 2010 18:09:42 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,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; Fri, 23 Apr 2010 18:09:35 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3NI9AMG015455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 23 Apr 2010 14:09:10 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3NI9AtN023651; Fri, 23 Apr 2010 14:09:10 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o3NI99Af016348; Fri, 23 Apr 2010 14:09:09 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id B751337849C; Fri, 23 Apr 2010 12:09:08 -0600 (MDT) From: Tom Tromey To: Joel Brobecker Cc: Mihail Zenkov , gdb-patches@sourceware.org Subject: Re: D language support References: <20100109082524.263bcb17.mihai.zenkov@gmail.com> <20100109082830.dd984de8.mihai.zenkov@gmail.com> <20100109142327.GC2007@adacore.com> <20100113064026.14f75ff2.mihai.zenkov@gmail.com> <20100415012124.91ce1769.mihai.zenkov@gmail.com> <20100421025919.ad3a0830.mihai.zenkov@gmail.com> <20100421155657.GA19194@adacore.com> <20100422030910.7e84f7ea.mihai.zenkov@gmail.com> <20100422004441.GE19194@adacore.com> Reply-To: tromey@redhat.com Date: Fri, 23 Apr 2010 18:09:00 -0000 In-Reply-To: <20100422004441.GE19194@adacore.com> (Joel Brobecker's message of "Wed, 21 Apr 2010 20:44:41 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-04/txt/msg00806.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> Although making the variable static limits the damage, I pretty strongly Joel> disagree that having this inter-routine global makes the code more Joel> readable. But, as I said, I don't see this as a blocking problem because Joel> it's localized to an area that I hope will require little attention from Joel> anyone but you; so I am happy to let it go provided that another Global Joel> Maintainer says it's OK - I'll try to remember to ask Tom for his take Joel> on it, if no one else provides an opinion... I took another look at it. I agree with Joel. In this case, the variables in question could easily be replaced with function arguments. I realize this means adding a bunch of "*"s all over the place, which is kind of ugly. But the flip side is that globals make functions more difficult to understand in isolation. I also realize that this sort of thing appears elsewhere. I'd rather we not emulate bad decisions in new code, though. I saw a couple more style nits too, more in the next note. Tom