error: if condition proceeds with a bool variable that is false
fake_indices_ =false; // member variable initialized somewhere elsebool MultiviewGICP::initCompute() { std::cout <<"fake_indices_ = "<< fake_indices_ << std::endl; // this prints 0, and confirms that fake_indices_ was indeed initialized as falseif (fake_indices_) { std::cout <<"we are getting here."<< std::endl; // the weird thing is that this line of code gets printed out, // meaning that we reached this code block, suppressing the if condition } // the root cause of this problem was the missing of the return statement below, // which is required of this function. // Without it, program proceeds with whatever code being compiled in the memory.returntrue; // if you put directly "if (false)", the above code block will not be executed, // since they may be optimized out during compilation.}
error: variable or field declared void
// for example it happens in this casevoidinitializeJSP(unknownType Experiment);// another example (due to the missing 'typename' keyword)template <typenamePointT>voidfunc(pcl::PointCloud<PointT>::Ptr& cloud) {} // errorvoidfunc(typename pcl::PointCloud<PointT>::Ptr& cloud) {} // correct