From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27960 invoked by alias); 24 Nov 2003 19:24:42 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 27952 invoked from network); 24 Nov 2003 19:24:42 -0000 Received: from unknown (HELO legolas.inter.net.il) (192.114.186.24) by sources.redhat.com with SMTP; 24 Nov 2003 19:24:42 -0000 Received: from zaretski ([80.230.153.167]) by legolas.inter.net.il (Mirapoint Messaging Server MOS 3.3.7-GR) with ESMTP id AVD94587; Mon, 24 Nov 2003 21:23:40 +0200 (IST) Date: Mon, 24 Nov 2003 19:24:00 -0000 From: "Eli Zaretskii" To: Andrew Cagney Message-Id: <2914-Mon24Nov2003212333+0200-eliz@elta.co.il> CC: gdb-patches@sources.redhat.com In-reply-to: <3FC234C0.1000500@gnu.org> (message from Andrew Cagney on Mon, 24 Nov 2003 11:41:36 -0500) Subject: Re: [commit] Deprecate remaining STREQ uses Reply-to: Eli Zaretskii References: <3FC119EB.1060102@gnu.org> <3FC234C0.1000500@gnu.org> X-SW-Source: 2003-11/txt/msg00531.txt.bz2 > Date: Mon, 24 Nov 2003 11:41:36 -0500 > From: Andrew Cagney > > > > Sorry, I don't get the rationale for renaming STR* into > > DEPRECATED_STR*. Are we going to throw away the code that used > > STREQN/STREQ? If not, I don't see any good reasons to do this, as > > renaming the macro doesn't get us any closer to the goal of replacing > > them with a simple call to the appropriate str* function. > > > > Could you please explain why the renaming is a good idea? > > Note that I'm renaming the _remaining_ STR*s and not all references. I must be dense today, because I still don't get it. What is the importance of ``remaining'' in this case? I understand that you replaced some of the uses of STR* macros, those that you could test on the system(s) you have available to you, with the direct call to the str* functions. I can also understand (although I basically disagree, see below) why you don't want to replace those uses which you cannot test. But why does it make sense to rename them? Why not just leave them alone? What am I missing? > Since the before/after results were identical, I'm pretty sure > those changes were ok. Do we really need to test a purely mechanistic replacement of STREQ with strcmp() == 0? > While I could blindly transform those remaining references, such an > operation would be untested and consequently runs the very real risk of > introducing bugs (remember my test run didn't cover them). Consequently > they've been deprecated. I don't think simply replacing the macros with their expansion could introduce bugs. If you don't trust your eyes and hands, perhaps Emacs's c-macro-expand command (or some other similar automated tool) could help. But even if I accept your reasoning about possible bugs, I still don't get why renaming the macros is a good idea. It sounds simply a gratuitous change.