From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: MS-Windows warnings (was build failure) for Emacs master Date: Tue, 12 Apr 2016 15:52:43 -0700 Organization: UCLA Computer Science Department Message-ID: <570D7C3B.90206@cs.ucla.edu> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1460501585 4832 80.91.229.3 (12 Apr 2016 22:53:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Apr 2016 22:53:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Angelo Graziosi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 13 00:52:55 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 1aq7B1-00073h-7S for ged-emacs-devel@m.gmane.org; Wed, 13 Apr 2016 00:52:55 +0200 Original-Received: from localhost ([::1]:59217 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aq7B0-0002qL-MR for ged-emacs-devel@m.gmane.org; Tue, 12 Apr 2016 18:52:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aq7Aw-0002nM-T2 for emacs-devel@gnu.org; Tue, 12 Apr 2016 18:52:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aq7As-0000Fx-SM for emacs-devel@gnu.org; Tue, 12 Apr 2016 18:52:50 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:57061) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aq7As-0000Fl-MJ for emacs-devel@gnu.org; Tue, 12 Apr 2016 18:52:46 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9CFD8161258; Tue, 12 Apr 2016 15:52:44 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id XP12xGMzbC9q; Tue, 12 Apr 2016 15:52:43 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9359E16125E; Tue, 12 Apr 2016 15:52:43 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 4Bwg2Nad2Dud; Tue, 12 Apr 2016 15:52:43 -0700 (PDT) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 6306C161258; Tue, 12 Apr 2016 15:52:43 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 In-Reply-To: <570D6093.8010305@alice.it> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 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:202874 Archived-At: On 04/12/2016 01:54 PM, Angelo Graziosi wrote: > current build logs have a lot of "garbage" like this: > > [...] > C:/msys64/tmp/mingw-w64-emacs-git/src/emacs/lib-src/ntlib.c:110:15: > warning: format '%d' expects argument of type 'int', but argument 2 > has type 'DWORD {aka long unsigned int}' [-Wformat=] > > printf ("Checking parent status failed: %d\n", GetLastError ()); For portable code, that would be a valid warning. If GetLastError returns unsigned long, the format should use %lu, not %d 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 ()); | Perhaps %u happens to work on both 32- and 64-bit MS-Windows, and if so then plain %u should suffice in practice. > checking whether C compiler handles -Wbuiltin-macro-redefined... yes > [...] > > Why enabling this by default? All this should be OFF by default and > only the maintainers which need it should enable it Warnings are enabled by default in master if you have a .git subdirectory (and thus are more likely to be a maintainer-type). See the thread containing this email: http://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00174.html and the followup change here: http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=5baecbc0ebc11178edd73431b644a5de0a31be25 It would be easy enough to disable -Wformat warnings when compiling anything under MS-Windows), if MS-Windows developers would prefer that. I'd rather leave these warnings enabled on non-MS-Windows platforms, though, as they're useful for catching portability glitches.