]> git.ipfire.org Git - thirdparty/libvirt.git/commit
maint: tighten strncmp syntax check
authorEric Blake <eblake@redhat.com>
Wed, 17 Nov 2010 23:41:31 +0000 (16:41 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 18 Nov 2010 19:21:58 +0000 (12:21 -0700)
commitd2af8ffcd8b75dfb59bbe5cd214a0a082fee0465
tree837adfe6365a7b857fde0e3857baf090dc626a9a
parentdec720aa93712ab90e6949b8af044cac5e599b61
maint: tighten strncmp syntax check

Using 'int ret = strcmp(a, b)' in a qsort function is a valid use of
str[n]cmp that should _not_ be turned to STREQ, but it was falling
foul of our specific syntax-check.  Meanwhile, gnulib's maint.mk
already has a tighter bound for strcmp, so we can copy that regex and
just check for strncmp, which results in fewer false positives that
require exceptions.

* cfg.mk (sc_prohibit_strcmp_and_strncmp): Rename...
(sc_prohibit_strncmp): ...to this, and tighten, to mirror
maint.mk's sc_prohibit_strcmp's better regex.
* Makefile.am (syntax_check_exceptions): Update exception rule.
* .x-sc_prohibit_strcmp_and_strncmp: Rename...
* .x-sc_prohibit_strncmp: ...and trim.
.x-sc_prohibit_strcmp_and_strncmp [deleted file]
.x-sc_prohibit_strncmp [new file with mode: 0644]
Makefile.am
cfg.mk