From nobody Tue Feb 10 06:27:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61832+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61832+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1593514160; cv=none; d=zohomail.com; s=zohoarc; b=YpzmacHrFNAU+gB7iP5CEujs1IIXygWcCROCMwmPuIAk93/vXHwCTYVsSdfKajqVwsJM8Y1XgzCuBSQlsIO3ce+eomTYVOvyVkf+qsqMXBU/yGSgpf3HWB/6tJX6HzPVlHwEwvjeMhavllpej0W7Z6RG5+3H/VAxcNdVXMjBrpM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593514160; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=MFCGUJ3knPTYk3RrKyo6zwGWMLygfCoYd8Udf1wa7Ak=; b=K16ClmKXHYH4vMDa5q+anGPBN1elXLftLSFn/cT8eu2bgD97oqWCS7P66d5nx3jvAdCflghuDf4Ll3dRsWV7p+PZq9tmjuPMWSniYEbBV0IvYIajUSDL7iLAdnRMhI0PCEOOOcKEnT28/37McvvBVOi5TB52t65NAEw9+LnnCEk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61832+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1593514160769959.3514481094921; Tue, 30 Jun 2020 03:49:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rJ0LYY1788612xRtoaF87CRg; Tue, 30 Jun 2020 03:49:19 -0700 X-Received: from cam-smtp0.cambridge.arm.com (cam-smtp0.cambridge.arm.com [217.140.106.53]) by mx.groups.io with SMTP id smtpd.web12.12711.1593514150733839398 for ; Tue, 30 Jun 2020 03:49:11 -0700 X-Received: from E119881.Arm.com (E119881.Arm.com [10.1.197.28]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id 05UAn70u025781; Tue, 30 Jun 2020 11:49:07 +0100 From: "PierreGondois" To: devel@edk2.groups.io Cc: Pierre Gondois , leif@nuviainc.com, ard.biesheuvel@arm.com, nd@arm.com Subject: [edk2-devel] [PATCH v1 2/2] EmbeddedPkg: Add cast from (void*) for VS2017 build Date: Tue, 30 Jun 2020 11:49:01 +0100 Message-Id: <20200630104901.11648-3-pierre.gondois@arm.com> In-Reply-To: <20200630104901.11648-1-pierre.gondois@arm.com> References: <20200630104901.11648-1-pierre.gondois@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com X-Gm-Message-State: 1jDHdIAecUIo48tqYvJJKYFtx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1593514159; bh=rIcVp0hpG6TmzDKVXqQwFJNIESzjPteGVT3/LBBM1FM=; h=Cc:Date:From:Reply-To:Subject:To; b=Lfb04QN5MZQvPT1FKg2/8QOcvpbcUMughOOq6v5a6TKT0WV4mU0lbQOvT1e202gwDnX /Tb0d1vPd9ovOj5FrInfcEgl5IjKrt0fA6Zzqifqvw+lea3kTDsTppJAm1kTiPV0JNbyz pJOMwIwQiqMvM9vTfxj2eWnWxLPx7b+n4v4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois The following build configrations: build -b DEBUG -a AARCH64 -t VS2017 -p edk2\EmbeddedPkg\EmbeddedPkg.dsc build -b NOOPT -a AARCH64 -t VS2017 -p edk2\EmbeddedPkg\EmbeddedPkg.dsc build -b RELEASE -a AARCH64 -t VS2017 -p edk2\EmbeddedPkg\EmbeddedPkg.dsc are generating the following build errors: edk2\EmbeddedPkg\Library\AndroidBootImgLib\AndroidBootImgLib.c(100): error C2036: 'void *': unknown size edk2\EmbeddedPkg\Library\AndroidBootImgLib\AndroidBootImgLib.c(347): error C2036: 'void *': unknown size Since the size of void* depends on the architecture, it can be dangerous to use void* pointer arithmetic. Plus the C99 doesn't state that void* pointer arithmetic is allowed. This patch adds a cast to fix the Visual Studio errors reported. Signed-off-by: Pierre Gondois --- The changes can be seen at: https://github.com/PierreARM/edk2/commits/831_F= ix_VS2017_build_error_v1 Notes: v1: - Fix VS2017 build errors. [Pierre] EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c | 13 ++++++++---= -- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c b/Em= beddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c index e1036954ee586dfc30266eec2897d71bfc949038..bbe0d41018b3d5665c72ee61efe= 737ae57b1b2eb 100644 --- a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c +++ b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2013-2014, ARM Ltd. All rights reserved.
+ Copyright (c) 2013-2020, ARM Ltd. All rights reserved.
Copyright (c) 2017, Linaro. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent @@ -97,7 +97,7 @@ AndroidBootImgGetKernelInfo ( ASSERT (IS_VALID_ANDROID_PAGE_SIZE (Header->PageSize)); =20 *KernelSize =3D Header->KernelSize; - *Kernel =3D BootImg + Header->PageSize; + *Kernel =3D (UINT8*)BootImg + Header->PageSize; return EFI_SUCCESS; } =20 @@ -339,9 +339,12 @@ AndroidBootImgUpdateFdt ( goto Fdt_Exit; } =20 - Status =3D AndroidBootImgSetProperty64 (UpdatedFdtBase, ChosenNode, - "linux,initrd-end", - (UINTN)(RamdiskData + RamdiskSize)= ); + Status =3D AndroidBootImgSetProperty64 ( + UpdatedFdtBase, + ChosenNode, + "linux,initrd-end", + (UINTN)((UINT8*)RamdiskData + RamdiskSize) + ); if (EFI_ERROR (Status)) { goto Fdt_Exit; } --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#61832): https://edk2.groups.io/g/devel/message/61832 Mute This Topic: https://groups.io/mt/75211231/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-