From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: Warnings in mingw64 build on emacs-28 branch Date: Sun, 07 Nov 2021 20:57:38 +0100 Message-ID: <87ee7rg2ml.fsf@telefonica.net> References: <86y260c9b8.fsf@gmail.com> <83fss880qc.fsf@gnu.org> <87r1bsezfn.fsf@telefonica.net> <8335o795e6.fsf@gnu.org> <87ilx3g44e.fsf@telefonica.net> <83y25z7oh6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11289"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:TyLLc0VSu5rhMEEC7ekcTZspw24= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 07 20:59:19 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mjoJz-0002mz-8Z for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 20:59:19 +0100 Original-Received: from [::1] (port=42000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjoJy-0001Si-9N for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 14:59:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjoIa-0008CL-QD for emacs-devel@gnu.org; Sun, 07 Nov 2021 14:57:55 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:52666) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjoIX-0001f7-9P for emacs-devel@gnu.org; Sun, 07 Nov 2021 14:57:51 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mjoIU-0000pY-0V for emacs-devel@gnu.org; Sun, 07 Nov 2021 20:57:46 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.248, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:278981 Archived-At: Eli Zaretskii 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.