From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: New warnings on emacs-26 branch with gcc 8.2.0 Date: Tue, 14 Aug 2018 22:20:45 +0100 Message-ID: <86y3d88x1u.fsf@gmail.com> References: <86a7q0ai2z.fsf@gmail.com> <6d36dc4c-1e14-b6c8-e2f0-911d08f759e1@cs.ucla.edu> <83in4os01j.fsf@gnu.org> <16f2754a-b40e-4bc4-f95a-9bada460d5a4@cs.ucla.edu> <83bma9mh3z.fsf@gnu.org> <86eff52njj.fsf@gmail.com> <83wosxkwfz.fsf@gnu.org> <864lg1rlp0.fsf@gmail.com> <83mutslt8f.fsf@gnu.org> <86in4gixg3.fsf@gmail.com> <83d0uolpxt.fsf@gnu.org> <86600giwct.fsf@gmail.com> <861sb4iv2d.fsf@gmail.com> <838t5clnxk.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1534281575 23637 195.159.176.226 (14 Aug 2018 21:19:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Aug 2018 21:19:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (windows-nt) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 14 23:19:31 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fpgiw-00063L-0P for ged-emacs-devel@m.gmane.org; Tue, 14 Aug 2018 23:19:30 +0200 Original-Received: from localhost ([::1]:46321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpgl2-00051Y-E4 for ged-emacs-devel@m.gmane.org; Tue, 14 Aug 2018 17:21:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpgkN-00051K-6B for emacs-devel@gnu.org; Tue, 14 Aug 2018 17:20:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpgkJ-00022v-6w for emacs-devel@gnu.org; Tue, 14 Aug 2018 17:20:59 -0400 Original-Received: from [195.159.176.226] (port=60565 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fpgkI-000203-VX for emacs-devel@gnu.org; Tue, 14 Aug 2018 17:20:55 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fpgiA-00055x-2F for emacs-devel@gnu.org; Tue, 14 Aug 2018 23:18:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:7YDY2cY6qogn+5daIenk2iVrBpk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228539 Archived-At: On Tue 14 Aug 2018, Andy Moreton wrote: > On Sat 11 Aug 2018, Eli Zaretskii wrote: > >>> From: Andy Moreton >>> Date: Sat, 11 Aug 2018 20:04:26 +0100 >>> >>> >> Or maybe we should introduce our ownj get_proc_address, which returns >>> >> a (void (*)(void)) pointer. But that's not for emacs-26, sorry. >> >> Yes, that's what I had in mind, just with a comment explaining why we >> need to jump through that particular hoop. > > The attached patch fixes the -Wcast-function-type warnings when building > on Windows MSYS2 64bit (GCC 8.2.0) with "-Og". Theere is one remaining > compiler warning: > > C:/emacs/git/emacs/master/src/w32fns.c: In function 'Fw32_read_registry': > C:/emacs/git/emacs/master/src/w32fns.c:10142:21: warning: 'rootkey' may be used uninitialized in this function [-Wmaybe-uninitialized] > Lisp_Object val = w32_read_registry (NILP (root) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ? HKEY_CURRENT_USER > ~~~~~~~~~~~~~~~~~~~ > : rootkey, > ~~~~~~~~~~ > key, name); > ~~~~~~~~~~ There is also one function cast warning from gnulib code: C:/emacs/git/emacs/master/lib/gettimeofday.c: In function 'initialize': C:/emacs/git/emacs/master/lib/gettimeofday.c:48:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'void (*)(FILETIME *)' {aka 'void (*)(struct _FILETIME *)'} [-Wcast-function-type] (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime"); ^