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



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)


Personally, I recommend the latter - I think part of the motivation for
eliminating STREQ was to get rid of that extra test, right?  If you
want to do this mechanically, you can just change the definition of
STREQ first, of course.

My question is somewhat retorical. I'd expect everyone to express a preference for the latter. What's needed is for people to recognize that such a transformation could potentially alter the program's behavior. It shouldn't but if it does it's not my fault.


Andrew



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