From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.5354.1593248729114878490 for ; Sat, 27 Jun 2020 02:05:29 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A0B4430E; Sat, 27 Jun 2020 02:05:27 -0700 (PDT) Received: from [192.168.1.69] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CB8173F6CF; Sat, 27 Jun 2020 02:05:26 -0700 (PDT) Subject: Re: [PATCH v2 1/1] ArmPkg/ArmMmuLibb: Fix implicit cast To: PierreGondois , devel@edk2.groups.io Cc: leif@nuviainc.com, lersek@redhat.com, nd@arm.com References: <20200626152804.88820-1-pierre.gondois@arm.com> From: "Ard Biesheuvel" Message-ID: <31ee568d-aae1-358b-f3c7-a814ce9ee0cf@arm.com> Date: Sat, 27 Jun 2020 11:05:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200626152804.88820-1-pierre.gondois@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 6/26/20 5:28 PM, PierreGondois wrote: > From: Pierre Gondois > > While building with the following command line: > build -b DEBUG -a AARCH64 -t VS2017 -p > edk2\MdeModulePkg\MdeModulePkg.dsc > > A missing cast triggers the following warning, > then triggering an error: > edk2/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c(652): > warning C4152: nonstandard extension, function/data pointer > conversion in expression > > This patch first casts the function pointer to (UINTN), > then to (VOID*), followowing the C99 standard s6.3.2.3 > "Pointer", paragraphs 5 and 6. This allows to remove the > warning. > > Signed-off-by: Pierre Gondois Merged as #731 Thanks, > --- > > The changes can be seen at: https://github.com/PierreARM/edk2/commits/831_Fix_implicit_cast_v2 > > Notes: > v1: > - Add (void*) cast. [Pierre] > v2: > - First cast to (UINTN) to conform to c99 specification. [Lazlo] > > ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c > index 222ff817956feb738325fc78fbaf064de98802a9..5fcd410061f0f0940cd761819ab49f598e2b4b00 100644 > --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c > +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c > @@ -649,7 +649,7 @@ ArmMmuBaseLibConstructor ( > // The ArmReplaceLiveTranslationEntry () helper function may be invoked > // with the MMU off so we have to ensure that it gets cleaned to the PoC > // > - WriteBackDataCacheRange (ArmReplaceLiveTranslationEntry, > + WriteBackDataCacheRange ((VOID*)(UINTN)ArmReplaceLiveTranslationEntry, > ArmReplaceLiveTranslationEntrySize); > > return RETURN_SUCCESS; >