From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#14043: 24.3.50; Compiler warning in cygw32 build on x86_64-cygwin Date: Sat, 23 Mar 2013 20:25:03 +0200 Message-ID: <8338vm3reo.fsf@gnu.org> References: <514DDB06.6070408@cornell.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1364063165 12804 80.91.229.3 (23 Mar 2013 18:26:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Mar 2013 18:26:05 +0000 (UTC) Cc: 14043@debbugs.gnu.org To: Ken Brown Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 23 19:26:31 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UJT9D-0002at-5s for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Mar 2013 19:26:31 +0100 Original-Received: from localhost ([::1]:36347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJT8p-0006DJ-GC for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Mar 2013 14:26:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJT8j-00065Y-CK for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2013 14:26:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJT8i-0005QV-73 for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2013 14:26:01 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJT8i-0005Q3-1h for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2013 14:26:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UJTAg-0001wo-Fa for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2013 14:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Mar 2013 18:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14043 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14043-submit@debbugs.gnu.org id=B14043.13640632297420 (code B ref 14043); Sat, 23 Mar 2013 18:28:02 +0000 Original-Received: (at 14043) by debbugs.gnu.org; 23 Mar 2013 18:27:09 +0000 Original-Received: from localhost ([127.0.0.1]:42490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJT9o-0001vc-Ml for submit@debbugs.gnu.org; Sat, 23 Mar 2013 14:27:09 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:41374) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJT9i-0001vO-UE for 14043@debbugs.gnu.org; Sat, 23 Mar 2013 14:27:06 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MK400G00LJ8AS00@a-mtaout21.012.net.il> for 14043@debbugs.gnu.org; Sat, 23 Mar 2013 20:24:58 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MK400GC8LTL9Z30@a-mtaout21.012.net.il>; Sat, 23 Mar 2013 20:24:58 +0200 (IST) In-reply-to: <514DDB06.6070408@cornell.edu> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72842 Archived-At: > Date: Sat, 23 Mar 2013 12:40:38 -0400 > From: Ken Brown > > In w32term.c:w32_initialize, the line > > DWORD input_locale_id = (DWORD) GetKeyboardLayout (0); > > (line 6666 in the current trunk) generates a "cast from pointer to > integer of different size" warning in the cygw32 build on 64-bit Cygwin. > I think that the warning can be safely ignored in this case, but I > would prefer to avoid it. > > The attached patch fixes this. Does the alternative patch below also work? I'd like to avoid ifdef's, if possible. If you still see a warning, please show the 64-bit Cygwin definitions for DWORD, DWORD_PTR, HANDLE, and HKL. > I'm wondering, however, whether the same warning occurs on 64-bit > Windows. The Microsoft compiler emits much more warnings than even the latest picky versions of GCC, so I'm quite sure it also warns here, and the warning is (quite correctly) ignored. === modified file 'src/w32term.c' --- src/w32term.c 2013-03-23 09:01:14 +0000 +++ src/w32term.c 2013-03-23 18:19:24 +0000 @@ -6663,7 +6663,7 @@ w32_initialize (void) Fset_input_mode (Qnil, Qnil, make_number (2), Qnil); { - DWORD input_locale_id = (DWORD) GetKeyboardLayout (0); + DWORD input_locale_id = ((DWORD_PTR) GetKeyboardLayout (0) & 0xffffffff); w32_keyboard_codepage = codepage_for_locale ((LCID) (input_locale_id & 0xffff)); }