Re: [commit] Deprecate remaining STREQ uses

Andrew Cagney
2003-11-25T18:42:47Z

>> 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