[PATCH V3] parsers.c: avoid implicit conversion loses integer precision warnings

Yuya Nishihara yuya at tcha.org
Wed Aug 19 07:48:01 CDT 2015


On Tue, 18 Aug 2015 15:05:23 -0400, Jordi Gutiérrez Hermoso wrote:
> On Tue, 2015-08-18 at 20:52 +0200, André Sintzoff wrote:
> > # HG changeset patch
> > # User André Sintzoff <andre.sintzoff at gmail.com>
> > # Date 1439902654 -7200
> > #      Tue Aug 18 14:57:34 2015 +0200
> > # Node ID ae1dbf8a309b47660abbce73b4a7351518ffe433
> > # Parent  9e7d805925c87cfa0ca30819e8273ac37fd77a62
> > parsers.c: avoid implicit conversion loses integer precision warnings
> > 
> > These warnings are raised by Apple LLVM version 6.1.0 (clang-602.0.53)
> > (based on LLVM 3.6.0svn) and were introduced in ff89383a97db
> 
> I would still like to see the LLVM diagnostics. Can you please put
> them in the commit message? It would help to understand what you're
> trying to fix.

  % make local CFLAGS='-Wshorten-64-to-32' CC=clang
  ...
  mercurial/parsers.c:1178:28: warning: implicit conversion loses integer
  precision: 'long' to 'int' [-Wshorten-64-to-32]
                          tovisit[lentovisit++] = revnum;
                                                ~ ^~~~~~
  mercurial/parsers.c:1218:12: warning: implicit conversion loses integer
  precision: 'long' to 'int' [-Wshorten-64-to-32]
                  minidx = minroot;
                         ~ ^~~~~~~


More information about the Mercurial-devel mailing list