[commit] Deprecate remaining STREQ uses

Eli Zaretskii eliz@elta.co.il
Mon Nov 24 19:24:00 GMT 2003

> Date: Mon, 24 Nov 2003 11:41:36 -0500
> From: Andrew Cagney <cagney@gnu.org>
> > 
> > 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.

More information about the Gdb-patches mailing list