Subject: 24.3.50; Compiler warning in cygw32 build on x86_64-cygwin
From: Ken Brown <[email-masked]>
To: [email-masked]
Date: Sat, 23 Mar 2013 12:40:38 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

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.  I'm wondering, however, whether the same 
warning occurs on 64-bit Windows.  If so, maybe that should be fixed at 
the same time, but I don't know enough about Windows programming to do this.

Ken

In GNU Emacs 24.3.50.2 (x86_64-pc-cygwin)
  of 2013-03-20 on fiona
Bzr revision: 112086 [email-masked]
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
  `configure --without-makeinfo --with-w32 CFLAGS=-g3 -O0'
=== modified file 'src/w32term.c'
--- src/w32term.c	2013-03-15 10:07:29 +0000
+++ src/w32term.c	2013-03-23 05:52:28 +0000
@@ -6651,7 +6651,11 @@
   Fset_input_mode (Qnil, Qnil, make_number (2), Qnil);
 
   {
+#ifdef CYGWIN
+    uintptr_t input_locale_id = (uintptr_t) GetKeyboardLayout (0);
+#else
     DWORD input_locale_id = (DWORD) GetKeyboardLayout (0);
+#endif
     w32_keyboard_codepage =
       codepage_for_locale ((LCID) (input_locale_id & 0xffff));
   }