From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, n.jayaprakash@intel.com
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] Query Errors / warnings observed on edk2/EmbeddedPkg
Date: Fri, 2 Feb 2024 15:33:16 +0100 [thread overview]
Message-ID: <01296486-5b14-4b73-b9dc-777a723548cf@redhat.com> (raw)
In-Reply-To: <PH7PR11MB59439F118F875BE9F28709C4EE422@PH7PR11MB5943.namprd11.prod.outlook.com>
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
> <https://github.com/tianocore/edk2-libc/tree/master/AppPkg/Applications/Python/Python-3.6.8>; Yammer Group <https://web.yammer.com/main/groups/eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiI5OTYwMDE3OTIwMCJ9/all>
>
> CCG Python Academy <https://degreed.com/plan/3127217?newWindow=true>
>
> Rust Programming – Yammer Group
> <https://web.yammer.com/main/groups/eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxNDM2MTA2NTg4MTYifQ/all>
>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
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]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-02-02 14:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 10:14 [edk2-devel] Query Errors / warnings observed on edk2/EmbeddedPkg Jayaprakash, N
2024-02-02 14:33 ` Laszlo Ersek [this message]
2024-02-02 14:54 ` Jayaprakash, N
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=01296486-5b14-4b73-b9dc-777a723548cf@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox