[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] qemu-upstream compile failure in intel_iommu.c:vtd_cont
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] qemu-upstream compile failure in intel_iommu.c:vtd_context_device_invalidate |
Date: |
Thu, 28 Jan 2016 10:07:33 +0000 |
On 28 January 2016 at 08:45, Paolo Bonzini <address@hidden> wrote:
>
>
> On 27/01/2016 19:23, Olaf Hering wrote:
>>
>> xen.git/tools/qemu-xen-dir/hw/i386/intel_iommu.c: In function
>> ‘vtd_context_device_invalidate’:
>> xen.git/tools/qemu-xen-dir/hw/i386/intel_iommu.c:911:46: error: ‘mask’ may
>> be used uninitialized in this function [-Werror=maybe-uninitialized]
>> if (vtd_as && ((devfn_it & mask) == (devfn & mask))) {
>> ^
>> It works with -O2. From the code flow its clear that mask is always
>> initialized. Looks like gcc 5.2.1 does no proper diagnostic at -O1.
>> What should be done with such issues, are they fixed in the code?
>
> It's probably simplest to add a
>
> default:
> abort();
>
> to the switch statement above.
glib provides a g_assert_not_reached() for this purpose, which is slightly
more self-documenting.
thanks
-- PMM