From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Warnings in mingw64 build on emacs-28 branch Date: Sun, 07 Nov 2021 17:05:47 +0200 Message-ID: <83fss880qc.fsf@gnu.org> References: <86y260c9b8.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3162"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Andy Moreton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 07 16:07:29 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 1mjjlY-0000aS-Ej for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 16:07:28 +0100 Original-Received: from localhost ([::1]:39248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjjlX-0007Pd-4d for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 10:07:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjjk8-0006Ke-WE for emacs-devel@gnu.org; Sun, 07 Nov 2021 10:06:01 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46890) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjjk8-0004t6-MT; Sun, 07 Nov 2021 10:06:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ISOMS2IbdzPW4XNWeidyGezDkHw1pFijR8e/XXB1rBU=; b=WQhMUfdXZ06i rCZ5YgsBoSD28gg9MUTMNt8+wydfmlyrikt6Uhb0OpTauBhpaJTAqIBXA0LB5DjjLVEgFq1iUcR7C pmtyaTg1+6l3jXM2O46EclZG6TtFcVFDKLFmQZE6dU3g90DWROrZlA7INOa9HZOpHjI/x9G3YlqBL x2VWfjmaNMt9FSH73oXPXJILz7R0BKvzJOtMZ85tvbTJDNY5+/Q9Byxwpo7RAIkrkzsjtdrY8z8vv V9LqCCKziCXkfi+XnnJUTNKJf8XCp8rLADV8KchFHPtBPF+aFIyJQGMpv9xNJh4Wf0A89RAhmw7KZ iwyEi2PUXJ1pu+bvc10rqA==; Original-Received: from [87.69.77.57] (port=2526 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjjk8-0005n2-6f; Sun, 07 Nov 2021 10:06:00 -0500 In-Reply-To: <86y260c9b8.fsf@gmail.com> (message from Andy Moreton on Sun, 07 Nov 2021 14:46:51 +0000) 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:278960 Archived-At: > From: Andy Moreton > Date: Sun, 07 Nov 2021 14:46:51 +0000 > > 1) In w32.h, "prepare_standard_handles" and "reset_standard_handles" > have "HANDLE handles[4]" argument, but the handle array has 3 elements > in the definitions and callers. I hope I fixed this now. > 2) This warning has been present for a long time, and seems to be > confusion over the flexible array handling. I'm not sure what this is about. We use memcpy to copy from a Lisp vector's contents in gazillion other places, and I understand they don't cause any warnings? How is this place different? > 3) This warning is new with gcc 11. > > C:/emacs/git/emacs/emacs-28/src/w32heap.c: In function 'getrlimit': > C:/emacs/git/emacs/emacs-28/src/w32heap.c:853:14: warning: 'm' may be used uninitialized [-Wmaybe-uninitialized] > 853 | if (!VirtualQuery ((LPCVOID) &m, &m, sizeof m)) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:25, > from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70, > from C:/emacs/git/emacs/emacs-28/src/w32common.h:24, > from C:/emacs/git/emacs/emacs-28/src/w32heap.c:54: > C:/msys64/mingw64/x86_64-w64-mingw32/include/memoryapi.h:45:28: note: by argument 1 of type 'LPCVOID' {aka 'const void *'} to 'VirtualQuery' declared here > 45 | WINBASEAPI SIZE_T WINAPI VirtualQuery (LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength); > | ^~~~~~~~~~~~ > C:/emacs/git/emacs/emacs-28/src/w32heap.c:844:34: note: 'm' declared here > 844 | MEMORY_BASIC_INFORMATION m; > | ^ That's a compiler bug, I think. I see nothing wrong in the call.