[libvirt] PATCH: Remove use of strcmp, etc

Jim Meyering jim at meyering.net
Fri May 9 21:40:39 UTC 2008


"Daniel P. Berrange" <berrange at redhat.com> wrote:

> This patch removes all use of strcmp, strncmp, strcasecmp and strncasecmp
> in favour of the equality macros we have defined in internal.h, eg STREQ,
> STRNEQ, STRNEQLEN, STREQLEN, etc, etc

Nice.  With that, you can remove sc_prohibit_strcmp
from the list of disabled checks in Makefile.cfg.
You might want to extend the corresponding regexp in Makefile.maint
to prohibit the other completely excluded functions like strncmp.

BTW, did you make this change automatically?  or do a binary before/after
comparison.  In which case there's not much point in reviewing the details...

> The only strcasecmp left is in virsh where it is used in a sort function
> so does genuinely need the -1, 0, +1  tristate return value rather than a
> simple boolean for equality.




More information about the libvir-list mailing list