From: Igor Mammedov <imammedo@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: lvivier@redhat.com, thuth@redhat.com, mst@redhat.com,
qemu-devel@nongnu.org, Jason Andryuk <jandryuk@gmail.com>
Subject: Re: [PATCH] qtest: fix 'expression is always false' build failure in qtest_has_accel()
Date: Fri, 29 Oct 2021 13:48:56 +0200 [thread overview]
Message-ID: <20211029134856.6e198416@redhat.com> (raw)
In-Reply-To: <4a5fcb6e-2c8a-397b-2e60-95b3c45b05d0@redhat.com>
On Wed, 27 Oct 2021 17:59:44 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:
> 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++)".
Thanks,
I've sent v2 with Michael suggested approach,
it seems to me a bit more cleaner.
>
> Paolo
>
prev parent reply other threads:[~2021-10-29 11:53 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
2021-10-29 11:48 ` Igor Mammedov [this message]
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=20211029134856.6e198416@redhat.com \
--to=imammedo@redhat.com \
--cc=jandryuk@gmail.com \
--cc=lvivier@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@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.