From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: qemu-upstream compile failure in intel_iommu.c:vtd_context_device_invalidate Date: Thu, 28 Jan 2016 09:45:25 +0100 Message-ID: <56A9D525.7060607@redhat.com> References: <20160127182352.GA5526@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20160127182352.GA5526@aepfle.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Olaf Hering , Stefano Stabellini Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org List-Id: xen-devel@lists.xenproject.org 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. Paolo