[patch] TODO more cleanups

Eli Zaretskii eliz@delorie.com
Wed Nov 22 00:25:00 GMT 2000


> From: jtc@redback.com (J.T. Conklin)
> Date: 21 Nov 2000 10:59:42 -0800
> 
> My take on this is that macros like STREQ() are nothing more than
> syntactic sugar.  We don't define macros like:
> 
>         #define begin   {
>         #define end     }
> 
> to make it "easier", and IMO by the same token there's no need to
> define macros like STREQ().

I agree that replacing strcmp with STREQ in the existing code is
controversial.  What I was questioning was the opposite replacement:
why is it worth the hassle of submitting patches, reviewing them by
the relevant maintainers, possibly breaking working code in the
process (by typos and what's not), etc. etc., just to replace STREQ
with its textual expansion?

> And in this case, it's important.  As part of a (dubious, IMO) micro-
> optimization, the STR* macros evaluate their arguments multiple times.

That's a different issue.  I think the discussions about this in the
past concluded that the micro-optimization was superfluous and that it
should be removed.  However, doing so requires to change the
definition of STREQ and nothing else.  The multiple evaluation problem
will go away as well, as a result of this.


More information about the Gdb-patches mailing list