From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.groups.io with SMTP id smtpd.web11.47715.1585568389472165773 for ; Mon, 30 Mar 2020 04:39:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B0jf5JkZ; spf=pass (domain: redhat.com, ip: 216.205.24.74, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585568388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v9jUepqK22RMyMHbdSLaQmDwQ9w5Ju9XWr/nnYTpMgs=; b=B0jf5JkZjw3iDj89GaMhqYYBU3ASW0KRT7zMfru4QKkNGvgRJee/VOSbraSub/31wHSsXk I/NWt3kQD3x3grlIJ1COu0setuL3zQQ6tHTJkxZuD+OOrFeHi8/Vm3tKEqwDFcxLSL9x4C roUnz0JEFuzuxBGZ1Il9ascFUrR/UP8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-aoiFgIBiPw6mtstA728oKg-1; Mon, 30 Mar 2020 07:39:43 -0400 X-MC-Unique: aoiFgIBiPw6mtstA728oKg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 511AF1922961; Mon, 30 Mar 2020 11:39:42 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-191.ams2.redhat.com [10.36.112.191]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EB2C8AC36; Mon, 30 Mar 2020 11:39:41 +0000 (UTC) Subject: Re: [PATCH] OvmfPkg/GenericQemuLoadImageLib: Fix VS2019 UINT32 conversion error To: Ard Biesheuvel , devel@edk2.groups.io References: <20200329135104.6560-1-ard.biesheuvel@linaro.org> From: "Laszlo Ersek" Message-ID: <5166f7b1-aca5-fca1-43c9-942c630198b9@redhat.com> Date: Mon, 30 Mar 2020 13:39:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200329135104.6560-1-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 03/29/20 15:51, Ard Biesheuvel wrote: > Building OVMF for X64 with secure boot enabled on VS2019 results in > the following error: > > d:\a\1\s\OvmfPkg\Library\GenericQemuLoadImageLib\GenericQemuLoadImageLib.c(154): > error C2220: the following warning is treated as an error > d:\a\1\s\OvmfPkg\Library\GenericQemuLoadImageLib\GenericQemuLoadImageLib.c(154): > warning C4244: '=': conversion from 'UINTN' to 'UINT32', possible loss of data > > Suppress the error by making the cast explicit. > > Link: https://bugzilla.tianocore.org/show_bug.cgi?id=2636 > Signed-off-by: Ard Biesheuvel > --- > OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c b/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c > index f7f9a205f99d..14c8417d43e7 100644 > --- a/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c > +++ b/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c > @@ -151,7 +151,7 @@ QemuLoadKernelImage ( > // > // Drop the terminating NUL, convert to UTF-16. > // > - KernelLoadedImage->LoadOptionsSize = (CommandLineSize - 1) * 2; > + KernelLoadedImage->LoadOptionsSize = (UINT32)((CommandLineSize - 1) * 2); > } > > QemuFwCfgSelectItem (QemuFwCfgItemInitrdSize); > Reviewed-by: Laszlo Ersek Thank you very much! Laszlo