[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Warnings in mingw64 build on emacs-28 branch
From: |
Eli Zaretskii |
Subject: |
Re: Warnings in mingw64 build on emacs-28 branch |
Date: |
Sun, 07 Nov 2021 22:02:35 +0200 |
> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Sun, 07 Nov 2021 20:57:38 +0100
>
> > 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.
I actually tend to think that this is a compiler bug that should be
reported to the GCC folks.
Re: Warnings in mingw64 build on emacs-28 branch, Andy Moreton, 2021/11/07