bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ


From: Kieran Colford
Subject: Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ
Date: Thu, 22 May 2014 00:31:16 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 14-05-22 12:28 AM, Eric Blake wrote:
> On 05/21/2014 10:14 PM, Paul Eggert wrote:
>> Kieran Colford wrote:
>>> +#define STRNEQ(X, Y) (strcmp (X, Y) != 0)
>>
>> 1.  This name is poorly chosen (it looks too much like "strncmp", which
>> means something quite different) and it's not needed (people can just
>> use "!STREQ").
>>
>> 2.  STREQ should be an inline function, not a macro.  There's little
>> point to making it a macro.
>>
>> 3.  STREQ's name should be lower case.
> 
> If it is made an inline function rather than a macro, then yes it should
> be lower case.  But if we do this, then we need to update the
> syntax-check rule that was created to force the use of STREQ in the
> first place, which has a ripple effect on a number of projects already
> using STREQ as a macro.
> 

I deliberately chose to use it as a macro and call it this because that
is how it is done everywhere else in gnulib.  If you want to see for
yourself, just run ``git grep "STRN\?EQ"''.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]