Building the project on Linux currently results in around 480 warnings, and around a quarter of them are caused by for loops comparing signed ints with unsigned std::vector<T>::size_type, such as the warning shown below.
/home/rui/develop/TexasSolver/src/Card.cpp:59: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string<char> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
../../../src/Card.cpp: In static member function ‘static uint64_t Card::boardCards2long(std::vector<std::__cxx11::basic_string<char> >)’:
../../../src/Card.cpp:59:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string<char> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
59 | for(int i = 0;i < cards.size();i++){
| ~~^~~~~~~~~~~~~~
The goal of this issue is to lower the warning count by updating these for loops to use unsigned ints for its indexes.
Building the project on Linux currently results in around 480 warnings, and around a quarter of them are caused by for loops comparing signed
int
s with unsignedstd::vector<T>::size_type
, such as the warning shown below.The goal of this issue is to lower the warning count by updating these
for
loops to use unsigned ints for its indexes.