GNU bug report logs -
#14043
24.3.50; Compiler warning in cygw32 build on x86_64-cygwin
Previous Next
Reported by: Ken Brown <kbrown <at> cornell.edu>
Date: Sat, 23 Mar 2013 16:43:02 UTC
Severity: normal
Found in version 24.3.50
Done: Ken Brown <kbrown <at> cornell.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Date: Sat, 23 Mar 2013 12:40:38 -0400
> From: Ken Brown <kbrown <at> cornell.edu>
>
> 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));
}
This bug report was last modified 12 years and 64 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.