All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>, qemu-devel@nongnu.org
Cc: lvivier@redhat.com, thuth@redhat.com, mst@redhat.com,
	Jason Andryuk <jandryuk@gmail.com>
Subject: Re: [PATCH] qtest: fix 'expression is always false' build failure in qtest_has_accel()
Date: Wed, 27 Oct 2021 17:59:44 +0200	[thread overview]
Message-ID: <4a5fcb6e-2c8a-397b-2e60-95b3c45b05d0@redhat.com> (raw)
In-Reply-To: <20211027074542.2607865-1-imammedo@redhat.com>

On 27/10/21 09:45, Igor Mammedov wrote:
> If KVM is disabled or not present, qtest library build
> may fail with:
>     libqtest.c: In function 'qtest_has_accel':
>        comparison of unsigned expression < 0 is always false
>        [-Werror=type-limits]
>           for (i = 0; i < ARRAY_SIZE(targets); i++) {
> 
> due to empty 'targets' array.
> Fix it by compiling KVM related part only if
> CONFIG_KVM_TARGETS is set.

Another possibility is to add a trailing NULL to the array and change 
the loop to "for (i = 0; targets[i]; i++)".

Paolo



  parent reply	other threads:[~2021-10-27 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27  7:45 [PATCH] qtest: fix 'expression is always false' build failure in qtest_has_accel() Igor Mammedov
2021-10-27  8:33 ` Michael S. Tsirkin
2021-10-27 14:19   ` Jason Andryuk
2021-10-27 15:59 ` Paolo Bonzini [this message]
2021-10-29 11:48   ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4a5fcb6e-2c8a-397b-2e60-95b3c45b05d0@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jandryuk@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.