From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Suspicious warning in W64 build Date: Fri, 15 Sep 2017 12:03:58 +0300 Message-ID: <83bmmcmiyp.fsf@gnu.org> References: <1017454172.910810.1504618695244@mail.libero.it> <1146932094.13821.1504798935795@mail.libero.it> <83mv66z66p.fsf@gnu.org> <102a4c21-c275-c73e-ec53-0d85975dc968@cs.ucla.edu> <83a825znuf.fsf@gnu.org> <831snhzkgw.fsf@gnu.org> <837ex9x7vf.fsf@gnu.org> <83tw0cwcle.fsf@gnu.org> <83h8wcw3td.fsf@gnu.org> <83377vx3d0.fsf@gnu.org> <83ingnq01t.fsf@gnu.org> <83fubrpxsv.fsf@gnu.org> <83r2v9masw.fsf@gnu.org> <86a81xrndl.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1505466666 19237 195.159.176.226 (15 Sep 2017 09:11:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 15 Sep 2017 09:11:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andy Moreton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 15 11:11:02 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dsmeJ-0004qt-HM for ged-emacs-devel@m.gmane.org; Fri, 15 Sep 2017 11:10:59 +0200 Original-Received: from localhost ([::1]:52132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsmeQ-0004vs-V2 for ged-emacs-devel@m.gmane.org; Fri, 15 Sep 2017 05:11:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsmXV-0006mF-Gc for emacs-devel@gnu.org; Fri, 15 Sep 2017 05:04:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dsmXQ-0003HJ-Iu for emacs-devel@gnu.org; Fri, 15 Sep 2017 05:03:57 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsmXQ-0003H7-FC; Fri, 15 Sep 2017 05:03:52 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2766 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dsmXP-00035y-Tg; Fri, 15 Sep 2017 05:03:52 -0400 In-reply-to: <86a81xrndl.fsf@gmail.com> (message from Andy Moreton on Thu, 14 Sep 2017 22:17:26 +0100) 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:218316 Archived-At: > From: Andy Moreton > Date: Thu, 14 Sep 2017 22:17:26 +0100 > > There are still some issues with the pI format. This seems to fix them: > > diff --git a/src/lisp.h b/src/lisp.h > index c5aea9c34c..f522e5ee1c 100644 > --- a/src/lisp.h > +++ b/src/lisp.h > @@ -99,7 +99,7 @@ enum { EMACS_INT_WIDTH = LLONG_WIDTH, EMACS_UINT_WIDTH = ULLONG_WIDTH }; > later and the runtime version is 5.0.0 or later. Otherwise, > printf-like functions are declared with __ms_printf__ attribute, > which will cause a warning for %lld etc. */ > -# if defined __MINGW32__ \ > +# if defined __MINGW32__ && !defined MINGW_W64 \ > && (!defined __USE_MINGW_ANSI_STDIO \ > || !(GNUC_PREREQ (6, 0, 0) && __MINGW32_MAJOR_VERSION >= 5)) > # define pI "I64" Thanks, but that's not quite right, because it will cause the MinGW64 build to use "%lld" even when __USE_MINGW_ANSI_STDIO is _not_ defined, which will cause warnings of a different kind. (Right now, we define __USE_MINGW_ANSI_STDIO in config.h, but I wanted to make this future-proof.) So I pushed a slightly different change, which will hopefully fix the problem. Too bad MinGW64 uses a different versioning scheme... > There are also several similar warnings in unexw32.c due to signed/unsigned mismatch: > > ../../src/unexw32.c: In function 'copy_executable_and_dump_data': > ../../src/unexw32.c:503:10: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'long long int' [-Wformat=] > printf ("\t0x%"pDWP" Offset in input file.\n", s - p_infile->file_base); \ > ^ ~~~~~~~~~~~~~~~ > ../../src/unexw32.c:553:3: note: in expansion of macro 'COPY_CHUNK' > COPY_CHUNK ("Copying DOS header...", dos_header, > ^~~~~~~~~~ > ../../src/unexw32.c:475:21: note: format string is defined here > # define pDWP "16llx" > ^ Darn that GCC 7 paranoia with signed/unsigned mismatches in printf! GCC 6 doesn't warn here. > Should these be using the ptrdiff_t formatter pD from lisp.h ? No, that would cause the values be printed in decimal. I installed what should be a fix. Thanks.