Skip to content

error: narrowing conversion of ‘-128’ from ‘int’ to ‘char’ [-Wnarrowing] #173

@andreas-schwab

Description

@andreas-schwab

[ 5%] Building CXX object src/hobbits-core/CMakeFiles/hobbits-core.dir/bitarray.cpp.o
cd /home/abuild/rpmbuild/BUILD/hobbits-0.54.1/build/src/hobbits-core && /usr/bin/c++ -DHOBBITSCORE_LIBRARY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dhobbits_core_EXPORTS -I/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/build/src/hobbits-core/hobbits-core_autogen/include -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-sized-deallocation -O2 -g -DNDEBUG -std=gnu++11 -fPIC -fPIC -MD -MT src/hobbits-core/CMakeFiles/hobbits-core.dir/bitarray.cpp.o -MF CMakeFiles/hobbits-core.dir/bitarray.cpp.o.d -o CMakeFiles/hobbits-core.dir/bitarray.cpp.o -c /home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp
/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp:23:5: error: narrowing conversion of ‘-128’ from ‘int’ to ‘char’ [-Wnarrowing]
23 | -128, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01
| ^~~~
/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp:27:11: error: narrowing conversion of ‘-65’ from ‘int’ to ‘char’ [-Wnarrowing]
27 | 0x7f, -65, -33, -17, -9, -5, -3, -2
| ^~~
/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp:27:16: error: narrowing conversion of ‘-33’ from ‘int’ to ‘char’ [-Wnarrowing]
27 | 0x7f, -65, -33, -17, -9, -5, -3, -2
| ^~~
/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp:27:21: error: narrowing conversion of ‘-17’ from ‘int’ to ‘char’ [-Wnarrowing]
27 | 0x7f, -65, -33, -17, -9, -5, -3, -2
| ^~~
/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp:27:26: error: narrowing conversion of ‘-9’ from ‘int’ to ‘char’ [-Wnarrowing]
27 | 0x7f, -65, -33, -17, -9, -5, -3, -2
| ^~
/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp:27:30: error: narrowing conversion of ‘-5’ from ‘int’ to ‘char’ [-Wnarrowing]
27 | 0x7f, -65, -33, -17, -9, -5, -3, -2
| ^~
/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp:27:34: error: narrowing conversion of ‘-3’ from ‘int’ to ‘char’ [-Wnarrowing]
27 | 0x7f, -65, -33, -17, -9, -5, -3, -2
| ^~
/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp:27:38: error: narrowing conversion of ‘-2’ from ‘int’ to ‘char’ [-Wnarrowing]
27 | 0x7f, -65, -33, -17, -9, -5, -3, -2
| ^~
/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp: In member function ‘QString BitArray::toBin(qint64, int) const’:
/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp:834:35: warning: comparison of integer expressions of different signedness: ‘quint64’ {aka ‘long long unsigned int’} and ‘qint64’ {aka ‘long long int’} [-Wsign-compare]
834 | for (quint64 i = start; i < start + length; i ++) {
| ~~^~~~~~~~~~~~~~~~
/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp: In member function ‘QString BitArray::toHex(qint64, int) const’:
/home/abuild/rpmbuild/BUILD/hobbits-0.54.1/src/hobbits-core/bitarray.cpp:849:37: warning: comparison of integer expressions of different signedness: ‘quint64’ {aka ‘long long unsigned int’} and ‘qint64’ {aka ‘long long int’} [-Wsign-compare]
849 | for (quint64 i = start4; i < start4+length*4; i += 4) {
| ~~^~~~~~~~~~~~~~~~~~
make[2]: *** [src/hobbits-core/CMakeFiles/hobbits-core.dir/build.make:142: src/hobbits-core/CMakeFiles/hobbits-core.dir/bitarray.cpp.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions