From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#34106: 27.0.50; master build failed with MSYS2/MinGW-w64 Date: Wed, 16 Jan 2019 17:44:10 +0000 Message-ID: References: <20190116172826.GA8756@Kael> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1547660592 30216 195.159.176.226 (16 Jan 2019 17:43:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 16 Jan 2019 17:43:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) To: 34106@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 16 18:43:08 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gjpDX-0007ij-3s for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Jan 2019 18:43:07 +0100 Original-Received: from localhost ([127.0.0.1]:59601 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjpFe-0001M6-BA for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Jan 2019 12:45:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjpFU-0001Kx-2Z for bug-gnu-emacs@gnu.org; Wed, 16 Jan 2019 12:45:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjpFO-0005JE-Eh for bug-gnu-emacs@gnu.org; Wed, 16 Jan 2019 12:45:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34561) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gjpFO-0005J6-BK for bug-gnu-emacs@gnu.org; Wed, 16 Jan 2019 12:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gjpFO-00013u-7S for bug-gnu-emacs@gnu.org; Wed, 16 Jan 2019 12:45:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <20190116172826.GA8756@Kael> Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Jan 2019 17:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34106 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15476606924051 (code B ref -1); Wed, 16 Jan 2019 17:45:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Jan 2019 17:44:52 +0000 Original-Received: from localhost ([127.0.0.1]:33842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gjpFB-00013F-VE for submit@debbugs.gnu.org; Wed, 16 Jan 2019 12:44:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gjpFA-000132-HU for submit@debbugs.gnu.org; Wed, 16 Jan 2019 12:44:48 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:39320) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjpF4-00055K-AL for submit@debbugs.gnu.org; Wed, 16 Jan 2019 12:44:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjpF3-0001Dj-9f for bug-gnu-emacs@gnu.org; Wed, 16 Jan 2019 12:44:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjpF0-00053Q-L3 for bug-gnu-emacs@gnu.org; Wed, 16 Jan 2019 12:44:41 -0500 Original-Received: from [195.159.176.226] (port=56840 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gjpF0-0004xl-DX for bug-gnu-emacs@gnu.org; Wed, 16 Jan 2019 12:44:38 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gjpCb-0006Ia-Gw for bug-gnu-emacs@gnu.org; Wed, 16 Jan 2019 18:42:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 68 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:xWJXgb8Zu8EgDfqUqfJmeZxIazM= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:154490 Archived-At: On Thu 17 Jan 2019, Chris Zheng wrote: > When build master branch under MS-Windows I’m seeing this > > CC pdumper.o > pdumper.c: In function 'dump_cold_bignum': > pdumper.c:3447:53: error: conversion from 'size_t' {aka 'long long unsigned int'} to 'mp_size_t' {aka 'long int'} may change value [-Werror=conversion] > mp_limb_t limb = mpz_getlimbn (bignum->value, i); > cc1.exe: some warnings being treated as errors > > Because with MSYS2/MinGW-w64 the `long' is 32-bit instead of 64-bit. > > A explicit cast can fix it. > > diff --git a/src/pdumper.c b/src/pdumper.c > index 3787408e6d..9d5ace6c38 100644 > --- a/src/pdumper.c > +++ b/src/pdumper.c > @@ -3444,7 +3444,7 @@ dump_cold_bignum (struct dump_context *ctx, Lisp_Object object) > Fputhash (object, descriptor, ctx->bignum_data); > for (size_t i = 0; i < nlimbs; ++i) > { > - mp_limb_t limb = mpz_getlimbn (bignum->value, i); > + mp_limb_t limb = mpz_getlimbn (bignum->value, (mp_size_t) i); > dump_write (ctx, &limb, sizeof (limb)); > } > } > > Thank you, > > Chris The MSYS2/Mingw-w64 build also has a warning: C:/emacs/git/emacs/master/src/emacs.c: In function 'load_pdump': C:/emacs/git/emacs/master/src/emacs.c:752:28: warning: field precision specifier '.*' expects argument of type 'int', but argument 3 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=] sprintf (dump_file, "%.*s%s", argv0_len - 4, argv[0], suffix); ~~^~ ~~~~~~~~~~~~~ The following patch fixes the warning, and fixes the bug above without needing a cast: diff --git a/src/emacs.c b/src/emacs.c index c1133f2460..834f55b6f3 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -749,7 +749,7 @@ load_pdump (int argc, char **argv) /* Remove the .exe extension if present. */ argv0_len = strlen (argv[0]); if (argv0_len >= 4 && c_strcasecmp (argv[0] + argv0_len - 4, ".exe") == 0) - sprintf (dump_file, "%.*s%s", argv0_len - 4, argv[0], suffix); + sprintf (dump_file, "%.*s%s", (int)(argv0_len - 4), argv[0], suffix); else #endif sprintf (dump_file, "%s%s", argv[0], suffix); diff --git a/src/pdumper.c b/src/pdumper.c index 3787408e6d..db66e1ba26 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -3442,7 +3442,7 @@ dump_cold_bignum (struct dump_context *ctx, Lisp_Object object) dump_off_to_lisp ((mpz_sgn (bignum->value) < 0 ? -nlimbs : nlimbs))); Fputhash (object, descriptor, ctx->bignum_data); - for (size_t i = 0; i < nlimbs; ++i) + for (mp_size_t i = 0; i < nlimbs; ++i) { mp_limb_t limb = mpz_getlimbn (bignum->value, i); dump_write (ctx, &limb, sizeof (limb));