On Thu, Sep 18, 2025 at 04:13:20PM +0200, Bruno Haible wrote:
> Hi Alejandro,

Hi Bruno,

> > I still see some uses of strcmp(3) within gnulib.  Is there a reason for
> > them?  Should we replace them too?

[...]

> These are not strcmp, but other functions.

[...]

> These are merely comments.

[...]

> These are uses of strcmp which are not compared for == 0 or != 0.
> 
> > lib/gen-uni-tables.c:73:  return !strcmp (s1, s2);
> 
> This is source code that is not compiled with other gnulib modules.

[...]

> This is source code that is shared with glibc.

[...]

> This source code is part of 'relocatable-prog-wrapper', which
> better avoids too many Gnulib module dependencies.
> 
> > lib/string.in.h:812:  return !strcmp (__s1, __s2);
> > lib/setenv.c:446:# define STREQ(a, b) (strcmp (a, b) == 0)
> > lib/streq.h:177:  (strcmp (s1, s2) == 0)
> > lib/dfa.c:54:# define streq(a, b) (strcmp (a, b) == 0)
> 
> These are definitions of streq or STREQ or STREQ_OPT.

We could replace the definition in dfa.c, can't we?

> 
> > lib/exclude.c:333:            : strcmp (pattern, f));
> 
> streq could be used here, but it's a judgement call.

This one would be interesting.  When I read that one I wasn't sure if
the integer value was important, or if it was only important as a
boolean.  I think using streq() there would be an improvement.

Thanks!


Cheers,
Alex

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature

Reply via email to