Saturday, May 26, 2012

[Discuss-gnuradio] gr_vector_map.cc has uninitialized loop index vars (patch attached)

Hello list:

The recently added file gr_vector_map.cc has two loops with index variables that are never initialized. (Surprisingly, g++ -Wall does not catch this form.) They look like


for (unsigned int i; i < in_vlens.size(); i++) {
in_sizeofs.push_back(in_vlens[i]*item_size);
}

g++ 4.6.3 (Ubuntu) managed to generate an init of 0 anyway; g++ 4.2.1 (Mac) did not.

I've attached a small patch.

No comments:

Post a Comment