Menu

#226 cppcheck "Prefer prefix ++/-- operators for non-primitive types"

other
open
nobody
None
5
2013-09-04
2013-09-04
serval24
No

Hello,

I runned cppcheck (a static analyzer) on clucene sources.
I attached a patch for all warnings of type "Prefer prefix ++/-- operators for non-primitive types"

While I was doing this, I noticed this report:
[src/core/CLucene/index/CompoundFile.cpp:230] -> [src/core/CLucene/index/CompoundFile.cpp:228]: (warning) Missing bounds check for extra iterator increment in loop
Indeed:
227 bool CompoundFileReader::list(vector<string>* names) const{
228 for ( EntriesType::const_iterator i=entries->begin();i!=entries->end();++i ){
229 names->push_back(i->first);
230 ++i;
231 }
232 return true;
233 }

Julien

1 Attachments

Discussion


Log in to post a comment.