* bug#34106: 27.0.50; master build failed with MSYS2/MinGW-w64 @ 2019-01-16 17:28 Chris Zheng 2019-01-16 17:44 ` Andy Moreton [not found] ` <handler.34106.D34106.15476619845997.notifdone@debbugs.gnu.org> 0 siblings, 2 replies; 4+ messages in thread From: Chris Zheng @ 2019-01-16 17:28 UTC (permalink / raw) To: 34106 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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#34106: 27.0.50; master build failed with MSYS2/MinGW-w64 2019-01-16 17:28 bug#34106: 27.0.50; master build failed with MSYS2/MinGW-w64 Chris Zheng @ 2019-01-16 17:44 ` Andy Moreton 2019-01-16 18:06 ` Eli Zaretskii [not found] ` <handler.34106.D34106.15476619845997.notifdone@debbugs.gnu.org> 1 sibling, 1 reply; 4+ messages in thread From: Andy Moreton @ 2019-01-16 17:44 UTC (permalink / raw) To: 34106 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)); ^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#34106: 27.0.50; master build failed with MSYS2/MinGW-w64 2019-01-16 17:44 ` Andy Moreton @ 2019-01-16 18:06 ` Eli Zaretskii 0 siblings, 0 replies; 4+ messages in thread From: Eli Zaretskii @ 2019-01-16 18:06 UTC (permalink / raw) To: Andy Moreton; +Cc: 34106-done > From: Andy Moreton <andrewjmoreton@gmail.com> > Date: Wed, 16 Jan 2019 17:44:10 +0000 > > 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: Thanks, pushed. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <handler.34106.D34106.15476619845997.notifdone@debbugs.gnu.org>]
* bug#34106: 27.0.50; master build failed with MSYS2/MinGW-w64 [not found] ` <handler.34106.D34106.15476619845997.notifdone@debbugs.gnu.org> @ 2019-01-17 5:54 ` Chris Zheng 0 siblings, 0 replies; 4+ messages in thread From: Chris Zheng @ 2019-01-17 5:54 UTC (permalink / raw) To: 34106 Thank you, Andy and Eli. It builds. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-17 5:54 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-01-16 17:28 bug#34106: 27.0.50; master build failed with MSYS2/MinGW-w64 Chris Zheng 2019-01-16 17:44 ` Andy Moreton 2019-01-16 18:06 ` Eli Zaretskii [not found] ` <handler.34106.D34106.15476619845997.notifdone@debbugs.gnu.org> 2019-01-17 5:54 ` Chris Zheng
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).