foo.cc: In function ‘void GetNext(std::string, int*)’:
foo.cc:8:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
8 | while (j < t.length() - 1)
| ~~^~~~~~~~~~~~~~~~
foo.cc: In function ‘int KMP(std::string, std::string)’:
foo.cc:26:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
26 | while (i < s.length() && j < t.length())
| ~~^~~~~~~~~~~~
foo.cc:26:36: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
26 | while (i < s.length() && j < t.length())
| ~~^~~~~~~~~~~~
foo.cc:39:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
39 | if (j >= t.length())
| ~~~^~~~~~~~~~~~~