From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id F1322D81194 for ; Fri, 2 Feb 2024 14:33:27 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=kvSlgZu8L5L0kuBOdyCiMXxRrY7LUbEsCKUXYLN4qQA=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1706884406; v=1; b=g6TDgcGsKEYtE+Q8O/RbFGXcbXBlGtiZeM+q86bTnS2BRcLNG2xG14H4lEIzPIdxLkX2Rx9B Du39sKW3lxDmJQsSpbVtcX35T9EZoCLy3C1pGHbyzkYayazMqwAqqEA60kQgsrmwNdafRNMSyVg aSqpMRXclfK1/sZaxWRkQUIA= X-Received: by 127.0.0.2 with SMTP id XDS5YY7687511xGo03R6Y0hm; Fri, 02 Feb 2024 06:33:26 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.24002.1706884405902363601 for ; Fri, 02 Feb 2024 06:33:26 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-330-h6ye8Q21MM2m_Mi_d41haQ-1; Fri, 02 Feb 2024 09:33:22 -0500 X-MC-Unique: h6ye8Q21MM2m_Mi_d41haQ-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 49F12106D1A7; Fri, 2 Feb 2024 14:33:22 +0000 (UTC) X-Received: from [10.39.192.34] (unknown [10.39.192.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9E8C51121306; Fri, 2 Feb 2024 14:33:21 +0000 (UTC) Message-ID: <01296486-5b14-4b73-b9dc-777a723548cf@redhat.com> Date: Fri, 2 Feb 2024 15:33:16 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] Query Errors / warnings observed on edk2/EmbeddedPkg To: devel@edk2.groups.io, n.jayaprakash@intel.com Cc: "Kinney, Michael D" References: From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: 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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: FsMk0r7BFwzVeEeJqm1mGizBx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=g6TDgcGs; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) On 2/2/24 11:14, Jayaprakash, N wrote: > Hi All, > >   > > Is the EmbeddedPkg being actively developed by the Tianocore / edk2 > community? > >   > > I saw following Warnings & errors while trying to build it. > >   > > Want to check with the community leaders if it is worth investing time > in raising BZ and fixing these errors / warnings? > >   > > Please find the details of the errors / warnings as given below: > >   > > 1)  > > SyntaxWarning: invalid escape sequence '\C' > >   > > This warning message is seen with the latest edk2 code available in the > main branch. > > part of the build logs are copied over here for reference. > >   > > C:\Users\njayapra\github\edk2_work\edk2>build -b RELEASE -t VS2019 -a > X64 -p EmbeddedPkg\EmbeddedPkg.dsc > > C:\Users\njayapra\github\edk2_work\edk2\BaseTools\Source\Python\Workspace\DscBuildData.py:2952: SyntaxWarning: invalid escape sequence '\C' > >   PcdValueCommonPath = > os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], > "Source\C\Common\PcdValueCommon.c")) > I can't really comment on this; it is from a relatively old commit -- 484b1534ed8f ("BaseTools:copy the common PcdValueCommon.c to output directory", 2020-03-12). >   > >   > > 2. error C2036: 'void *': unknown size > >   > > c:\users\njayapra\github\edk2_work\edk2\EmbeddedPkg\Library\PrePiMemoryAllocationLib\MemoryAllocationLib.c(311): error C2036: 'void *': unknown size > This is a bug; please file a BZ. We shouldn't be doing pointer arithmetic on (VOID*). We should replace (UINTN)(OldBuffer + OldSize) with ((UINTN)OldBuffer + OldSize). >   > > 3. More errors and warnings: > > c:\users\njayapra\github\edk2_work\edk2\EmbeddedPkg\Include\libfdt_env.h(83): error C2220: the following warning is treated as an error > > c:\users\njayapra\github\edk2_work\edk2\EmbeddedPkg\Include\libfdt_env.h(83): warning C4244: 'function': conversion from 'int' to 'UINT8', possible loss of data > > c:\users\njayapra\github\edk2_work\edk2\EmbeddedPkg\Include\libfdt_env.h(93): warning C4244: 'return': conversion from 'INTN' to 'int', possible loss of data Filing a BZ for investigating these seems worthwhile too. For example: 86 static inline int 87 memcmp ( 88 const void *dest, 89 const void *src, 90 int len 91 ) 92 { 93 return CompareMem (dest, src, len); 94 } CompareMem returns INTN, which can be INT64, so the warning is *theoretically* correct. It's easy to shut up with an explicit cast to "int". Here's why such a cast is safe: the CompareMem documentation says, @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first mismatched byte in DestinationBuffer. so that will fit in a plain "int" too. Etc. Laszlo > > c:\users\njayapra\github\edk2_work\edk2\EmbeddedPkg\Include\libfdt_env.h(103): warning C4244: 'function': conversion from 'int' to 'UINT8', possible loss of data > > c:\users\njayapra\github\edk2_work\edk2\EmbeddedPkg\Include\libfdt_env.h(122): warning C4244: '=': conversion from 'int' to 'char', possible loss of data > > c:\users\njayapra\github\edk2_work\edk2\EmbeddedPkg\Library\FdtLib\fdt.c(93): warning C4018: '<': signed/unsigned mismatch > > c:\users\njayapra\github\edk2_work\edk2\EmbeddedPkg\Library\FdtLib\fdt.c(101): warning C4018: '<': signed/unsigned mismatch > > c:\users\njayapra\github\edk2_work\edk2\EmbeddedPkg\Library\FdtLib\fdt.c(302): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data > > c:\users\njayapra\github\edk2_work\edk2\EmbeddedPkg\Library\FdtLib\fdt.c(324): warning C4018: '>': signed/unsigned mismatch > >   > >   > >   > > Regards, > > Jayaprakash Nevara, > > System Software Architect > > CCG-CPE-C4S-India > > PyUEFI - Tianocore Project > ; Yammer Group > > CCG Python Academy > > Rust Programming – Yammer Group > > >   > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115050): https://edk2.groups.io/g/devel/message/115050 Mute This Topic: https://groups.io/mt/104116832/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-