GNU bug report logs - #14043
24.3.50; Compiler warning in cygw32 build on x86_64-cygwin

Previous Next

Package: emacs;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14043 in the body.
You can then email your comments to 14043 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14043; Package emacs. (Sat, 23 Mar 2013 16:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ken Brown <kbrown <at> cornell.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 23 Mar 2013 16:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Compiler warning in cygw32 build on x86_64-cygwin
Date: Sat, 23 Mar 2013 12:40:38 -0400
[Message part 1 (text/plain, inline)]
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 eggert <at> cs.ucla.edu-20130318210234-bpg2y8i713w6uqhr
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --without-makeinfo --with-w32 CFLAGS=-g3 -O0'
[w32term.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14043; Package emacs. (Sat, 23 Mar 2013 18:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 14043 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: 14043 <at> debbugs.gnu.org
Subject: Re: bug#14043: 24.3.50;
	Compiler warning in cygw32 build on x86_64-cygwin
Date: Sat, 23 Mar 2013 20:25:03 +0200
> 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));
   }





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14043; Package emacs. (Sat, 23 Mar 2013 22:36:02 GMT) Full text and rfc822 format available.

Message #11 received at 14043 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 14043 <at> debbugs.gnu.org
Subject: Re: bug#14043: 24.3.50;
	Compiler warning in cygw32 build on x86_64-cygwin
Date: Sat, 23 Mar 2013 18:33:14 -0400
On 3/23/2013 2:25 PM, Eli Zaretskii wrote:
> Does the alternative patch below also work?  I'd like to avoid
> ifdef's, if possible.

Yes, it does.  I too am glad to see a solution that avoids the ifdefs.

Thanks.

Ken





Reply sent to Ken Brown <kbrown <at> cornell.edu>:
You have taken responsibility. (Sun, 24 Mar 2013 00:21:01 GMT) Full text and rfc822 format available.

Notification sent to Ken Brown <kbrown <at> cornell.edu>:
bug acknowledged by developer. (Sun, 24 Mar 2013 00:21:02 GMT) Full text and rfc822 format available.

Message #16 received at 14043-done <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 14043-done <at> debbugs.gnu.org
Subject: Re: bug#14043: 24.3.50;
	Compiler warning in cygw32 build on x86_64-cygwin
Date: Sat, 23 Mar 2013 20:17:45 -0400
On 3/23/2013 6:33 PM, Ken Brown wrote:
> On 3/23/2013 2:25 PM, Eli Zaretskii wrote:
>> Does the alternative patch below also work?  I'd like to avoid
>> ifdef's, if possible.
>
> Yes, it does.  I too am glad to see a solution that avoids the ifdefs.

I've committed the change as bzr revision 112120 and am closing the bug 
report.

Ken




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 21 Apr 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 63 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.