qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] coverity: provide Coverity-friendly MIN_CONST and MAX_CONST


From: Eric Blake
Subject: Re: [PATCH] coverity: provide Coverity-friendly MIN_CONST and MAX_CONST
Date: Mon, 29 Jun 2020 10:35:37 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 6/29/20 10:21 AM, no-reply@patchew.org wrote:
Patchew URL: 
20200629151642.11974-1-pbonzini@redhat.com/">https://patchew.org/QEMU/20200629151642.11974-1-pbonzini@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [PATCH] coverity: provide Coverity-friendly MIN_CONST and MAX_CONST
Type: series
Message-id: 20200629151642.11974-1-pbonzini@redhat.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

 From https://github.com/patchew-project/qemu
  * [new tag]         patchew/20200629151642.11974-1-pbonzini@redhat.com -> 
patchew/20200629151642.11974-1-pbonzini@redhat.com
Switched to a new branch 'test'
3aee0de coverity: provide Coverity-friendly MIN_CONST and MAX_CONST

=== OUTPUT BEGIN ===
WARNING: architecture specific defines should be avoided
#38: FILE: include/qemu/osdep.h:269:
+#ifdef __COVERITY__

ERROR: Macros with complex values should be enclosed in parenthesis

Obvious false positive.

#39: FILE: include/qemu/osdep.h:270:
+#define MIN_CONST(a, b) (a) < (b) ? (a) : (b)

ERROR: Macros with complex values should be enclosed in parenthesis

But this one is a real complaint.  We really do want:

#define MIN_CONST(a, b) ((a) < (b) ? (a) : (b))

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

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