From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24952 invoked by alias); 25 Nov 2003 17:54:20 -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 24836 invoked from network); 25 Nov 2003 17:54:19 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 25 Nov 2003 17:54:19 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 0E48F2B8F; Tue, 25 Nov 2003 12:54:16 -0500 (EST) Message-ID: <3FC39747.2090007@gnu.org> Date: Tue, 25 Nov 2003 17:54:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Carlton , Eli Zaretskii Cc: gdb-patches@sources.redhat.com Subject: Re: [commit] Deprecate remaining STREQ uses References: <3FC119EB.1060102@gnu.org> <3FC234C0.1000500@gnu.org> <2914-Mon24Nov2003212333+0200-eliz@elta.co.il> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-11/txt/msg00568.txt.bz2 > On 25 Nov 2003 08:55:33 +0200, Eli Zaretskii said: > >>> From: David Carlton >>> Date: Mon, 24 Nov 2003 12:06:24 -0800 >>> >>> I was thinking that just using keyboard macros might do the trick: > > >> For such a simple job, it probably would. But c-macro-expand is more >> trustworthy, IMHO: it actually runs cpp and has provisions for you to >> specify the same compiler switches as are used during an actual >> compilation, so you don't run a risk of missing some obscure #define >> somewhere. > > > Actually, in the case at hand, they would give different results, it > turns out! The definition of STREQ isn't simply strcmp()==0 - there's > an optimization (or "optimization", perhaps) there as well. You'll now appreciate my paranoia :-) So, should the transformation be the strictly mechanical inline expansion: STREQ(a,b) => (*(a) == *(b) ? !strcmp ((a), (b)) : 0) or also include a simplification leading to: STREQ(a,b) => (strcmp ((a), (b)) == 0) Andrew