Re: [PATCH] gdb, gdbserver, gdbsupport: replace many uses of strcmp with streq

Simon Marchi
2026-03-16T17:30:15Z

On 3/16/26 1:18 PM, Andrew Burgess wrote:
> Simon Marchi <simon.marchi@efficios.com> writes:
>
>> Replace all occurrences of:
>>
>> strcmp (...) == 0
>> strcmp (...) != 0
>> !strcmp (...)
>> 0 == strcmp (...)
>> strcmp (...) directly used as a boolean predicate
>>
>> with the equivalent expression using streq.
>>
>> This is for consistency (we already use streq as some places in the
>> testsuite) but also for clarity. I think that streq is clearer on the
>> intent than strcmp. It's also a bit shorter.
>
> I haven't looked through every line of this patch, life's too short :)
> But I took a random sampling and it all looked good. I agree with the
> intent here, so:

Thanks for checking. The change was very mechanical. I also had it
reviewed by my buddy Claude Code, which would be good at spotting some
silly mistake that would reverse the logic of a condition.

> Approved-By: Andrew Burgess <aburgess@redhat.com>

Thanks, pushed.

Simon