foo.cc: In function ‘int findnum(std::string)’:
foo.cc:8:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
8 | for(int i=0;i<s.size();i++)
| ~^~~~~~~~~
foo.cc: In function ‘std::string finds1(std::string)’:
foo.cc:20:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
20 | for(int i=0;i<s.size();i++)
| ~^~~~~~~~~
foo.cc: In function ‘int findnum(std::string)’:
foo.cc:11:32: warning: ‘ret’ may be used uninitialized [-Wmaybe-uninitialized]
11 | ret=ret*10+s[i]-'0';
| ~~~^~~
foo.cc:7:13: note: ‘ret’ was declared here
7 | int ret;
| ^~~
In function ‘int findnum(std::string)’,
inlined from ‘int main()’ at foo.cc:49:12:
foo.cc:11:32: warning: ‘ret’ may be used uninitialized [-Wmaybe-uninitialized]
11 | ret=ret*10+s[i]-'0';
| ~~~^~~
foo.cc: In function ‘int main()’:
foo.cc:7:13: note: ‘ret’ was declared here
7 | int ret;
| ^~~
In function ‘int findnum(std::string)’,
inlined from ‘int main()’ at foo.cc:50:53:
foo.cc:11:32: warning: ‘ret’ may be used uninitialized [-Wmaybe-uninitialized]
11 | ret=ret*10+s[i]-'0';
| ~~~^~~
foo.cc: In function ‘int main()’:
foo.cc:7:13: note: ‘ret’ was declared here
7 | int ret;
| ^~~