From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9219 invoked by alias); 19 May 2017 03:03:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 9205 invoked by uid 89); 19 May 2017 03:03:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=tired, arguably X-HELO: mail-qt0-f172.google.com Received: from mail-qt0-f172.google.com (HELO mail-qt0-f172.google.com) (209.85.216.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 May 2017 03:03:38 +0000 Received: by mail-qt0-f172.google.com with SMTP id f55so49158026qta.3 for ; Thu, 18 May 2017 20:03:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ajDX8yUKk6MSEfD/VIDvAZ2GVZxtnLQ4MrfAX9F7A/E=; b=acn2SKgnULZVz69ZF6cgIlENsO1EkNJyAqPE+757IfDmPf3ni7X/vGCpnZN0++aSK+ oF260J3vV1WrWWEbPYpi1c9ra/I8eA9gAr3FJn6t3DKOhhPyngawdh5SbqdwwAxGnufw MF4/3wTaGkRgMvDnLK4TNqsBQAmi4/htlk5ft32oKjK7LVfZdH6KtxuJaSEO/azEVjq/ HQrIYDX3mf2hgud8u71WLh0GhJ8M0sa1aHhCvRTOH04sSRzX8dc4RQt8FrXKTpb501sW zwMEUI+pVcuWsp0udg7ajsriF5izm84lf1daMo8fllBRMDFPRJCHnMc65pbqi/DvM1Jm Rs0A== X-Gm-Message-State: AODbwcAmv6bJkHNs053v+cggkMIMogjjxQ5X3ia8YrdmznoO11IqrFN/ HimJXYrbWHqGwg== X-Received: by 10.200.2.172 with SMTP id p44mr6765689qtg.34.1495163020351; Thu, 18 May 2017 20:03:40 -0700 (PDT) Received: from localhost.localdomain (75-171-227-52.hlrn.qwest.net. [75.171.227.52]) by smtp.gmail.com with ESMTPSA id q5sm5076366qtb.52.2017.05.18.20.03.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 May 2017 20:03:39 -0700 (PDT) Subject: Re: RFA: PATCH to add id_strcmp helper function To: Jason Merrill , gcc-patches List References: From: Martin Sebor Message-ID: Date: Fri, 19 May 2017 03:13:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg01509.txt.bz2 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(). Martin