This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [commit] Deprecate remaining STREQ uses


> Date: Tue, 25 Nov 2003 12:54:15 -0500
> From: Andrew Cagney <cagney@gnu.org>
> > 
> > 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]