This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: PATCH to add id_strcmp helper function
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org,Jason Merrill <jason at redhat dot com>,Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 10 Jun 2017 07:54:31 +0200
- Subject: Re: RFA: PATCH to add id_strcmp helper function
- Authentication-results: sourceware.org; auth=none
- References: <CADzB+2=nUE9Ma58PpzfaC97+TxXd3bBJ3Er_ZeAQjXogfUsEcw@mail.gmail.com> <b9644643-c164-bc33-4818-f2b2e7f1b892@gmail.com> <CADzB+2nTdYJ9+jqdTpRdPynar3RG9CmFu3Go2fQnnmm808-ALA@mail.gmail.com> <CADzB+2=U2XdJPX62Qso+1G3z7fqmFJZ-yuS-qOZv9vT59V9=eA@mail.gmail.com>
On June 9, 2017 10:07:36 PM GMT+02:00, Jason Merrill <jason@redhat.com> wrote:
>On Tue, May 23, 2017 at 5:52 PM, Jason Merrill <jason@redhat.com>
>wrote:
>> On Thu, May 18, 2017 at 11:03 PM, Martin Sebor <msebor@gmail.com>
>wrote:
>>> On 05/18/2017 08:30 PM, Jason Merrill wrote:
>>>>
>>>> I got tired of writing strcmp (IDENTIFIER_POINTER and decided to
>wrap
>>>> it in an inline function. I decided to use "id_strcmp" instead of
>>>> just overloading strcmp, but I don't feel strongly about that
>choice.
>>>>
>>>> The second patch changes all existing uses of that pattern to use
>the
>>>> new function.
>>>>
>>>> OK for trunk?
>>>
>>>
>>> Since all the uses are of the form !id_strcmp(), would taking
>>> a step further and introducing a bool id_equal() be going too
>>> far?
>>>
>>> Besides being (arguably) easier to read, it would get around
>>> the question of whether it should be !id_strcmp() or
>>> id_strcmp == 0, or perhaps even 0 == id_strcmp().
>>
>> Makes sense.
>>
>> OK for trunk?
>
>Ping?
OK.
Richard.