simongog / sdsl

Succinct Data Structure Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems with install.sh (-Wnarrowing)

danielsaad opened this issue · comments

Dear all,
I'm having a problem when building sdsl by executing install.sh.
There is a compilation error due -Wnarrowing

The compilation log is attached:

/home/danielsaad/Desktop/sdsl-master/lib/bwt_construct.cpp: In function ‘bool sdsl::construct_bwt(sdsl::tMSS&, const string&, const string&)’:
/home/danielsaad/Desktop/sdsl-master/lib/bwt_construct.cpp:65:38: error: narrowing conversion of ‘-1’ from ‘int’ to ‘size_type {aka long unsigned int}’ inside { } [-Wnarrowing]
size_type to_add[2] = {-1,n-1};
^
/home/danielsaad/Desktop/sdsl-master/lib/bwt_construct.cpp: In function ‘bool sdsl::construct_bwt2(sdsl::tMSS&, const string&, const string&)’:
/home/danielsaad/Desktop/sdsl-master/lib/bwt_construct.cpp:137:34: error: narrowing conversion of ‘-1’ from ‘int’ to ‘size_type {aka long unsigned int}’ inside { } [-Wnarrowing]
size_type to_add[2] = {-1,n-1};
^
make[2]: *** [lib/CMakeFiles/sdsl.dir/build.make:135: lib/CMakeFiles/sdsl.dir/bwt_construct.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:122: lib/CMakeFiles/sdsl.dir/all] Error 2
make: *** [Makefile:128: all] Error 2
[ 5%] Building CXX object lib/CMakeFiles/sdsl.dir/bwt_construct.cpp.o
/home/danielsaad/Desktop/sdsl-master/lib/bwt_construct.cpp: In function ‘bool sdsl::construct_bwt(sdsl::tMSS&, const string&, const string&)’:
/home/danielsaad/Desktop/sdsl-master/lib/bwt_construct.cpp:65:38: error: narrowing conversion of ‘-1’ from ‘int’ to ‘size_type {aka long unsigned int}’ inside { } [-Wnarrowing]
size_type to_add[2] = {-1,n-1};
^
/home/danielsaad/Desktop/sdsl-master/lib/bwt_construct.cpp: In function ‘bool sdsl::construct_bwt2(sdsl::tMSS&, const string&, const string&)’:
/home/danielsaad/Desktop/sdsl-master/lib/bwt_construct.cpp:137:34: error: narrowing conversion of ‘-1’ from ‘int’ to ‘size_type {aka long unsigned int}’ inside { } [-Wnarrowing]
size_type to_add[2] = {-1,n-1};
^
make[2]: *** [lib/CMakeFiles/sdsl.dir/build.make:135: lib/CMakeFiles/sdsl.dir/bwt_construct.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:122: lib/CMakeFiles/sdsl.dir/all] Error 2
make: *** [Makefile:128: all] Error 2

Thanks for pointing out this issue.