On 12/13/2017 01:32 AM, Tim Rühsen wrote:
Now clang throws out an annoying warning about the return value of > timespec_cmp(): > > In file included from wget.c:51: >
../lib/timespec.h:94:20: warning: implicit conversion loses integer >
precision: 'long' to 'int' [-Wshorten-64-to-32] > return a.tv_nsec -
b.tv_nsec; > ~~~~~~ ~~~~~~~~~~^~~~~~~~~~~ > > I wonder if we can't
silence clang and gcc by keeping the 'assume()' > *and* using return
(int) (a.tv_nsec - b.tv_nsec));
I'd rather continue to omit the cast, as casts are too powerful (it's
too easy to get them wrong, with no diagnostic).
-Wshorten-64-to-32 is like -Wconversion, and we should ask people not to
use -Wshorten-64-to-32 in the same way that we ask them not to use
-Wconversion. Does it fix things to add -Wshorten-64-to-32 to
build-aux/gcc-warning.spec and to build-aux/g++-warning.spec?