/in/foo.cc: In function 'int main()':
/in/foo.cc:174:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i != str.size(); i++) {
~~^~~~~~~~~~~~~
/in/foo.cc:175:14: warning: array subscript has type 'char' [-Wchar-subscripts]
cnt[str[i]]++;
^
/in/foo.cc:188:58: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::__cxx11::basic_string<char>::size_type {aka long unsigned int}' [-Wformat=]
printf("%d %d %.1f\n", str.size() * 8, str.size(), 8.0);
^
/in/foo.cc:188:58: warning: format '%d' expects argument of type 'int', but argument 3 has type 'std::__cxx11::basic_string<char>::size_type {aka long unsigned int}' [-Wformat=]
/in/foo.cc:199:87: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::__cxx11::basic_string<char>::size_type {aka long unsigned int}' [-Wformat=]
printf("%d %d %.1f\n", str.size() * 8, sumWeight, (double)str.size() * 8 / sumWeight);
^
/in/foo.cc: In instantiation of 'void compute_length(node<T>*, int) [with T = int]':
/in/foo.cc:194:36: required from here
/in/foo.cc:162:6: warning: array subscript has type 'char' [-Wchar-subscripts]
len[root->getCh()] = depth;
~~~^
/in/foo.cc: In instantiation of 'node<T>::node(T) [with T = int]':
/in/foo.cc:149:12: required from 'node<T>* huffman(heap<node<T>*>) [with T = int]'
/in/foo.cc:192:43: required from here
/in/foo.cc:40:5: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
ch = NULL;
^