It complained about the previous code:
apt-pkg/sourcelist.cc: In destructor ‘pkgSourceList::~pkgSourceList()’:
apt-pkg/sourcelist.cc:278:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
for (pkgIndexFile * const File : VolatileFiles)
^
There really cannot be an overflow, though. Rewriting it like this
seems to fix it.
for (const_iterator I = SrcList.begin(); I != SrcList.end(); ++I)
delete *I;
SrcList.clear();
- for (pkgIndexFile * const File : VolatileFiles)
- delete File;
+ for (auto F = VolatileFiles.begin(); F != VolatileFiles.end(); ++F)
+ delete (*F);
VolatileFiles.clear();
}
/*}}}*/