OSX's compiler supports C++11 but one needs to use GNU's STL to build cppcheck, that does not have cbegin/end.

This commit is contained in:
Simon Martin 2014-02-01 07:40:08 +01:00
parent b3bfd5014d
commit 8ff9696374
3 changed files with 3 additions and 3 deletions

View File

@ -463,7 +463,7 @@ void CheckIO::checkWrongPrintfScanfArguments()
if (Token::Match(tok->next(), "( %any%") && _settings->library.formatstr_function(tok->str())) {
const std::map<int, Library::ArgumentChecks>& argumentChecks = _settings->library.argumentChecks.at(tok->str());
for (std::map<int, Library::ArgumentChecks>::const_iterator i = argumentChecks.cbegin(); i != argumentChecks.cend(); ++i) {
for (std::map<int, Library::ArgumentChecks>::const_iterator i = argumentChecks.begin(); i != argumentChecks.end(); ++i) {
if (i->second.formatstr) {
formatStringArgNo = i->first - 1;
break;

View File

@ -85,7 +85,7 @@ public:
}
bool formatstr_function(const std::string& funcname) const {
return _formatstr.find(funcname) != _formatstr.cend();
return _formatstr.find(funcname) != _formatstr.end();
}
bool formatstr_scan(const std::string& funcname) const {

View File

@ -270,7 +270,7 @@ std::size_t TestFixture::runTests(const options& args)
if (!missingLibs.empty()) {
std::cerr << "Missing libraries: ";
for (std::set<std::string>::const_iterator i = missingLibs.cbegin(); i != missingLibs.cend(); ++i)
for (std::set<std::string>::const_iterator i = missingLibs.begin(); i != missingLibs.end(); ++i)
std::cerr << *i << " ";
std::cerr << std::endl << std::endl;
}