From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Warnings in mingw64 build on emacs-28 branch Date: Sun, 07 Nov 2021 14:46:51 +0000 Message-ID: <86y260c9b8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33519"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt) To: emacs-devel@gnu.org Cancel-Lock: sha1:zsD5jl+/di7ElLeK5wZnSIOPUo4= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 07 15:47:58 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 1mjjSg-0008YU-Bv for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 15:47:58 +0100 Original-Received: from localhost ([::1]:56178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjjSe-00046z-WF for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 09:47:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjjRu-0003QM-5n for emacs-devel@gnu.org; Sun, 07 Nov 2021 09:47:10 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:41884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjjRs-0001L6-8t for emacs-devel@gnu.org; Sun, 07 Nov 2021 09:47:09 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mjjRn-0007QJ-4W for emacs-devel@gnu.org; Sun, 07 Nov 2021 15:47:03 +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: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, NML_ADSP_CUSTOM_MED=0.9, 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:278957 Archived-At: Hi, There are currently some warnings on the emacs-28 branch when building with 64bit mingw64 on Windows (gcc 11.2.0). 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. In function 'child_setup', inlined from 'emacs_spawn' at C:/emacs/git/emacs/emacs-28/src/callproc.c:1408:13: C:/emacs/git/emacs/emacs-28/src/callproc.c:1213:3: warning: 'prepare_standard_handles' accessing 32 bytes in a region of size 24 [-Wstringop-overflow=] 1213 | prepare_standard_handles (in, out, err, handles); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:/emacs/git/emacs/emacs-28/src/callproc.c: In function 'emacs_spawn': C:/emacs/git/emacs/emacs-28/src/callproc.c:1213:3: note: referencing argument 4 of type 'void **' In file included from C:/emacs/git/emacs/emacs-28/nt/inc/sys/socket.h:82, from C:/emacs/git/emacs/emacs-28/src/thread.h:25, from C:/emacs/git/emacs/emacs-28/src/lisp.h:2162, from C:/emacs/git/emacs/emacs-28/src/callproc.c:31: C:/emacs/git/emacs/emacs-28/src/w32.h:157:13: note: in a call to function 'prepare_standard_handles' 157 | extern void prepare_standard_handles (int in, int out, | ^~~~~~~~~~~~~~~~~~~~~~~~ In function 'child_setup', inlined from 'emacs_spawn' at C:/emacs/git/emacs/emacs-28/src/callproc.c:1408:13: C:/emacs/git/emacs/emacs-28/src/callproc.c:1217:3: warning: 'reset_standard_handles' accessing 32 bytes in a region of size 24 [-Wstringop-overflow=] 1217 | reset_standard_handles (in, out, err, handles); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:/emacs/git/emacs/emacs-28/src/callproc.c: In function 'emacs_spawn': C:/emacs/git/emacs/emacs-28/src/callproc.c:1217:3: note: referencing argument 4 of type 'void **' In file included from C:/emacs/git/emacs/emacs-28/nt/inc/sys/socket.h:82, from C:/emacs/git/emacs/emacs-28/src/thread.h:25, from C:/emacs/git/emacs/emacs-28/src/lisp.h:2162, from C:/emacs/git/emacs/emacs-28/src/callproc.c:31: C:/emacs/git/emacs/emacs-28/src/w32.h:161:13: note: in a call to function 'reset_standard_handles' 161 | extern void reset_standard_handles (int in, int out, | ^~~~~~~~~~~~~~~~~~~~~~ 2) This warning has been present for a long time, and seems to be confusion over the flexible array handling. C:/emacs/git/emacs/emacs-28/src/w32menu.c: In function 'set_frame_menubar': C:/emacs/git/emacs/emacs-28/src/w32menu.c:324:9: warning: 'memcpy' offset [3, 10] from the object at '' is out of the bounds of referenced subobject 'contents' with type 'struct Lisp_X *[]' at offset 3 [-Warray-bounds] 324 | memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 325 | previous_menu_items_used * word_size); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from C:/emacs/git/emacs/emacs-28/src/w32menu.c:26: C:/emacs/git/emacs/emacs-28/src/lisp.h:1638:17: note: subobject 'contents' declared here 1638 | Lisp_Object contents[FLEXIBLE_ARRAY_MEMBER]; | ^~~~~~~~ 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; | ^