From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30059 invoked by alias); 25 Nov 2003 19:14:25 -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 30052 invoked from network); 25 Nov 2003 19:14:24 -0000 Received: from unknown (HELO aragorn.inter.net.il) (192.114.186.23) by sources.redhat.com with SMTP; 25 Nov 2003 19:14:24 -0000 Received: from zaretski ([80.230.153.167]) by aragorn.inter.net.il (Mirapoint Messaging Server MOS 3.3.7-GR) with ESMTP id BYV23759; Tue, 25 Nov 2003 21:12:21 +0200 (IST) Date: Tue, 25 Nov 2003 19:14:00 -0000 From: "Eli Zaretskii" To: Andrew Cagney Message-Id: <9743-Tue25Nov2003211147+0200-eliz@elta.co.il> CC: carlton@kealia.com, gdb-patches@sources.redhat.com In-reply-to: <3FC39747.2090007@gnu.org> (message from Andrew Cagney on Tue, 25 Nov 2003 12:54:15 -0500) Subject: Re: [commit] Deprecate remaining STREQ uses Reply-to: Eli Zaretskii References: <3FC119EB.1060102@gnu.org> <3FC234C0.1000500@gnu.org> <2914-Mon24Nov2003212333+0200-eliz@elta.co.il> <3FC39747.2090007@gnu.org> X-SW-Source: 2003-11/txt/msg00574.txt.bz2 > Date: Tue, 25 Nov 2003 12:54:15 -0500 > From: Andrew Cagney > > > > 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 does Emacs ;-) > 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) IIRC, we decided long ago that the so-called ``optimization'' in the former macro definition was a waste of cycles. So my recommendation would be to use the latter.