Open LeMoussel opened 5 years ago
What steps will reproduce the problem?
serial
What is the expected output? No warnings
What do you see instead?
warning: variable ‘glob_retval’ set but not used [-Wunused-but-set-variable] int glob_retval = glob(patterns[0].c_str(), 0, NULL, &glob_results);
Trivially fixed by removing glob_retval variable :
glob_retval
vector<string> glob(const vector<string>& patterns) { vector<string> paths_found; if(patterns.size() == 0) return paths_found; glob_t glob_results; glob(patterns[0].c_str(), 0, NULL, &glob_results); vector<string>::const_iterator iter = patterns.begin(); while(++iter != patterns.end()) { glob(iter->c_str(), GLOB_APPEND, NULL, &glob_results); } for(unsigned int path_index = 0; path_index < glob_results.gl_pathc; path_index++) { paths_found.push_back(glob_results.gl_pathv[path_index]); } globfree(&glob_results); return paths_found; }
What steps will reproduce the problem?
serial
using gcc gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)What is the expected output? No warnings
What do you see instead?
Trivially fixed by removing
glob_retval
variable :