From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Angelo Graziosi Newsgroups: gmane.emacs.devel Subject: Re: MS-Windows warnings (was build failure) for Emacs master Date: Wed, 13 Apr 2016 01:36:38 +0200 Message-ID: <570D8686.1010907@alice.it> 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> 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 1460504331 12743 80.91.229.3 (12 Apr 2016 23:38:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Apr 2016 23:38:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 13 01:38:41 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 1aq7tF-0007n4-Tb for ged-emacs-devel@m.gmane.org; Wed, 13 Apr 2016 01:38:38 +0200 Original-Received: from localhost ([::1]:59901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aq7tE-0002Qs-Uj for ged-emacs-devel@m.gmane.org; Tue, 12 Apr 2016 19:38:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aq7rI-0007Jg-Im for emacs-devel@gnu.org; Tue, 12 Apr 2016 19:36:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aq7rF-0002mE-Be for emacs-devel@gnu.org; Tue, 12 Apr 2016 19:36:36 -0400 Original-Received: from smtp202.alice.it ([82.57.200.98]:22543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aq7rF-0002m1-0a for emacs-devel@gnu.org; Tue, 12 Apr 2016 19:36:33 -0400 Original-Received: from [192.168.1.101] (79.19.227.36) by smtp202.alice.it (8.6.060.43) (authenticated as angelo.graziosi@alice.it) id 5697B30A19356304; Wed, 13 Apr 2016 01:36:31 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 In-Reply-To: <570D7C3B.90206@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.98 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:202875 Archived-At: I continue to be of the opinion that those warning should be off by default. Only who take care of Windows port etc. should enable the option to have them, if one needs them, obviously.. In any case, I have already taken the appropriate countermeasures to shutdown them.. Angelo Il 13/04/2016 00:52, Paul Eggert ha scritto: > 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.