[libvirt] [PATCH 06/10] maint: tighten strncmp syntax check

Eric Blake eblake at redhat.com
Thu Nov 18 19:26:23 UTC 2010


On 11/18/2010 02:51 AM, Daniel P. Berrange wrote:
> On Wed, Nov 17, 2010 at 09:28:58PM -0700, Eric Blake wrote:
>> 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 |    9 ---------
>>  .x-sc_prohibit_strncmp            |    1 +
>>  Makefile.am                       |    2 +-
>>  cfg.mk                            |   14 ++++++++------
>>  4 files changed, 10 insertions(+), 16 deletions(-)
>>  delete mode 100644 .x-sc_prohibit_strcmp_and_strncmp
>>  create mode 100644 .x-sc_prohibit_strncmp
> 
> ACK

1-6 are now pushed after fixing some typos I noticed in the comments of
1 and 2; I'll respond to your comments on 7-8 and rebase 9-10 for
another round of review before pushing those.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101118/f20e74d9/attachment-0001.sig>


More information about the libvir-list mailing list