unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ken Brown <kbrown@cornell.edu>
Cc: 14043@debbugs.gnu.org
Subject: bug#14043: 24.3.50; Compiler warning in cygw32 build on x86_64-cygwin
Date: Sat, 23 Mar 2013 20:25:03 +0200	[thread overview]
Message-ID: <8338vm3reo.fsf@gnu.org> (raw)
In-Reply-To: <514DDB06.6070408@cornell.edu>

> Date: Sat, 23 Mar 2013 12:40:38 -0400
> From: Ken Brown <kbrown@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));
   }






  reply	other threads:[~2013-03-23 18:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23 16:40 bug#14043: 24.3.50; Compiler warning in cygw32 build on x86_64-cygwin Ken Brown
2013-03-23 18:25 ` Eli Zaretskii [this message]
2013-03-23 22:33   ` Ken Brown
2013-03-24  0:17     ` Ken Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8338vm3reo.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=14043@debbugs.gnu.org \
    --cc=kbrown@cornell.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).