zeeev / wham

Structural variant detection and association testing
Other
101 stars 25 forks source link

narrowing conversion error during installation #43

Closed Suncuss closed 7 years ago

Suncuss commented 7 years ago

Hi

I'm getting some narrowing conversion error during installation.

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

In file included from src/lib/phredUtils.h:16:0,
                 from src/bin/whamg.cpp:26:
src/lib/fastonebigheader.h: In function ‘{anonymous}::v4sf vfasterfc({anonymous}::v4sf)’:
src/lib/fastonebigheader.h:110:43: error: narrowing conversion of ‘9223372039002259456ull’ from ‘long long unsigned int’ to ‘long long int’ inside { } [-Wnarrowing]
 #define v2dil(x) ((const v4si) { (x), (x) })
                                           ^
src/lib/fastonebigheader.h:111:18: note: in expansion of macro ‘v2dil’
 #define v4sil(x) v2dil((((unsigned long long) (x)) << 32) | (x))
                  ^
src/lib/fastonebigheader.h:558:11: note: in expansion of macro ‘v4sil’
   vc.i |= v4sil (0x80000000);
           ^
src/lib/fastonebigheader.h:110:43: error: narrowing conversion of ‘9223372039002259456ull’ from ‘long long unsigned int’ to ‘long long int’ inside { } [-Wnarrowing]
 #define v2dil(x) ((const v4si) { (x), (x) })
                                           ^
src/lib/fastonebigheader.h:111:18: note: in expansion of macro ‘v2dil’
 #define v4sil(x) v2dil((((unsigned long long) (x)) << 32) | (x))
                  ^
src/lib/fastonebigheader.h:558:11: note: in expansion of macro ‘v4sil’
   vc.i |= v4sil (0x80000000);
           ^
src/lib/fastonebigheader.h: In function ‘{anonymous}::v4sf vfastsin({anonymous}::v4sf)’:
src/lib/fastonebigheader.h:110:43: error: narrowing conversion of ‘9223372039002259456ull’ from ‘long long unsigned int’ to ‘long long int’ inside { } [-Wnarrowing]
 #define v2dil(x) ((const v4si) { (x), (x) })
                                           ^
src/lib/fastonebigheader.h:111:18: note: in expansion of macro ‘v2dil’
 #define v4sil(x) v2dil((((unsigned long long) (x)) << 32) | (x))
                  ^
src/lib/fastonebigheader.h:1478:22: note: in expansion of macro ‘v4sil’
   v4si sign = vx.i & v4sil (0x80000000);
                      ^
src/lib/fastonebigheader.h:110:43: error: narrowing conversion of ‘9223372039002259456ull’ from ‘long long unsigned int’ to ‘long long int’ inside { } [-Wnarrowing]
 #define v2dil(x) ((const v4si) { (x), (x) })
                                           ^
src/lib/fastonebigheader.h:111:18: note: in expansion of macro ‘v2dil’
 #define v4sil(x) v2dil((((unsigned long long) (x)) << 32) | (x))
                  ^
src/lib/fastonebigheader.h:1478:22: note: in expansion of macro ‘v4sil’
   v4si sign = vx.i & v4sil (0x80000000);
                      ^
src/lib/fastonebigheader.h: In function ‘{anonymous}::v4sf vfastersin({anonymous}::v4sf)’:
src/lib/fastonebigheader.h:110:43: error: narrowing conversion of ‘9223372039002259456ull’ from ‘long long unsigned int’ to ‘long long int’ inside { } [-Wnarrowing]
 #define v2dil(x) ((const v4si) { (x), (x) })
                                           ^
src/lib/fastonebigheader.h:111:18: note: in expansion of macro ‘v2dil’
 #define v4sil(x) v2dil((((unsigned long long) (x)) << 32) | (x))
                  ^
src/lib/fastonebigheader.h:1499:22: note: in expansion of macro ‘v4sil’
   v4si sign = vx.i & v4sil (0x80000000);
                      ^
src/lib/fastonebigheader.h:110:43: error: narrowing conversion of ‘9223372039002259456ull’ from ‘long long unsigned int’ to ‘long long int’ inside { } [-Wnarrowing]
 #define v2dil(x) ((const v4si) { (x), (x) })
                                           ^
src/lib/fastonebigheader.h:111:18: note: in expansion of macro ‘v2dil’
 #define v4sil(x) v2dil((((unsigned long long) (x)) << 32) | (x))
                  ^
src/lib/fastonebigheader.h:1499:22: note: in expansion of macro ‘v4sil’
   v4si sign = vx.i & v4sil (0x80000000);
                      ^
Makefile:39: recipe for target 'bin/whamg' failed
make: *** [bin/whamg] Error 1

Thanks!

zeeev commented 7 years ago

@Suncuss Can you tell me what tool and system you're using to compile whamg?

Suncuss commented 7 years ago

@zeeev Linux Hostname 4.4.0-28-generic #47-Ubuntu SMP Fri Jun 24 10:09:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

cmake version 3.5.1

g++ --version g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

and I used the command provided in the readme git clone --recursive https://github.com/zeeev/wham.git; cd wham; make

edawson commented 7 years ago

I'm having this issue on Ubuntu 16.04, GCC/G++ 6.2.0, and a correspondingly modern version of Cmake. Any chance there's a fix?

FWIW I can compile if I switch the unsigned long long on line 111 to a long long, but I worry this is probably going to change program behavior (and my C++ knowledge isn't quite at the level required to decipher this macro, though intuition says it's just swapping a possibly negative number to a strictly positive one??).

zeeev commented 7 years ago

@edawson Thanks for the report. Can you link me to the line you're changing? I'll look into it.

edawson commented 7 years ago

Didn't think to link it. The offending line is here.

dence commented 7 years ago

I'm getting this same error w/ gcc 5.2.0. What version of gcc are you (Zev) developing this on?

zeeev commented 7 years ago

Fixed by @edawson in latest PR.