From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MS-Windows warnings (was build failure) for Emacs master Date: Tue, 19 Apr 2016 19:04:38 +0300 Message-ID: <831t618u09.fsf@gnu.org> References: <56CCD91E.6070507@alice.it> <83egc2ixji.fsf@gnu.org> <56CD798D.7060102@alice.it> <56CD8408.1000701@alice.it> <83wppuggb4.fsf@gnu.org> <56CE2CA7.5050906@alice.it> <83io1cg2pt.fsf@gnu.org> <56DA0327.2030009@alice.it> <83oaatxu72.fsf@gnu.org> <570C4307.6050907@alice.it> <87k2k3t5xb.fsf@russet.org.uk> <570D6093.8010305@alice.it> <570D7C3B.90206@cs.ucla.edu> <571652E3.6030506@lanl.gov> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1461081922 17124 80.91.229.3 (19 Apr 2016 16:05:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Apr 2016 16:05:22 +0000 (UTC) Cc: eggert@cs.ucla.edu, angelo.graziosi@alice.it, emacs-devel@gnu.org To: Davis Herring Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 19 18:05:17 2016 Return-path: Envelope-to: ged-emacs-devel@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 1asY9N-0006sp-7B for ged-emacs-devel@m.gmane.org; Tue, 19 Apr 2016 18:05:17 +0200 Original-Received: from localhost ([::1]:60780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asY9M-000482-LA for ged-emacs-devel@m.gmane.org; Tue, 19 Apr 2016 12:05:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asY92-0003d3-R7 for emacs-devel@gnu.org; Tue, 19 Apr 2016 12:05:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asY92-0002FK-2s for emacs-devel@gnu.org; Tue, 19 Apr 2016 12:04:56 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asY8v-0002DW-QK; Tue, 19 Apr 2016 12:04:49 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2525 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1asY8u-0000Ck-Tl; Tue, 19 Apr 2016 12:04:49 -0400 In-reply-to: <571652E3.6030506@lanl.gov> (message from Davis Herring on Tue, 19 Apr 2016 09:46:43 -0600) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:203098 Archived-At: > From: Davis Herring > Date: Tue, 19 Apr 2016 09:46:43 -0600 > Cc: emacs-devel@gnu.org, Angelo Graziosi > > > As I understand it, though, MS-Windows defines GetLastError to return > > unsigned int on 64-bit machines, and unsigned long on 32-bit machines > > (!). This idiosyncrasy could be handled in the MS-Windows port by > > something like this: > > > > |#ifdef __MINGW64__ # define pDWORD "" #else # define pDWORD "l" #endif > > and then the above code could be: printf ("Checking parent status > > failed: %"pDWORD"u\n", GetLastError ()); | > > I know the real problem has been addressed otherwise; however, surely > for this sort of variability (between just these two types) one should > simply write > > printf ("Checking parent status failed: %lu\n", > (unsigned long) GetLastError ()); > > without any preprocessor excitement. If GetLastError returned a 64-bit value on 64-bit Windows, as Paul thought, then your cast wouldn't be correct, of course, because 'unsigned long' is a 32-bit type on all versions of Windows.