[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Warnings in mingw64 build on emacs-28 branch
From: |
Óscar Fuentes |
Subject: |
Re: Warnings in mingw64 build on emacs-28 branch |
Date: |
Sun, 07 Nov 2021 20:57:38 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Eli Zaretskii <eliz@gnu.org> writes:
>> As for the warning, I think it is because a const void* is passed to
>> VirtualQuery pointing to an uninitialized object.
>
> I don't understand why the compiler thinks the object must be
> initialized for its pointer to be valid. Does the compiler assume
> something about what VirtualQuery does? Why does it think the
> function will dereference the pointer?
The warning says "may be used uninitialized". The compiler doesn't know,
it sees something suspicious and speaks up. That's with -Wall, without
it, the compiler remains silent.
I guess the MinGW headers should be annotated with whatever decoration
gcc uses to convey that the pointer is not dereferenced.
Or we can initialize `m' to zero, which will silence the warning and is
a good practice in general when working with the Windows API.
Re: Warnings in mingw64 build on emacs-28 branch, Andy Moreton, 2021/11/07