From 8ff9696374abd7683174142dac9a1127e8ad5758 Mon Sep 17 00:00:00 2001 From: Simon Martin Date: Sat, 1 Feb 2014 07:40:08 +0100 Subject: [PATCH] OSX's compiler supports C++11 but one needs to use GNU's STL to build cppcheck, that does not have cbegin/end. --- lib/checkio.cpp | 2 +- lib/library.h | 2 +- test/testsuite.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/checkio.cpp b/lib/checkio.cpp index 5eecc769f..2823c5660 100644 --- a/lib/checkio.cpp +++ b/lib/checkio.cpp @@ -463,7 +463,7 @@ void CheckIO::checkWrongPrintfScanfArguments() if (Token::Match(tok->next(), "( %any%") && _settings->library.formatstr_function(tok->str())) { const std::map& argumentChecks = _settings->library.argumentChecks.at(tok->str()); - for (std::map::const_iterator i = argumentChecks.cbegin(); i != argumentChecks.cend(); ++i) { + for (std::map::const_iterator i = argumentChecks.begin(); i != argumentChecks.end(); ++i) { if (i->second.formatstr) { formatStringArgNo = i->first - 1; break; diff --git a/lib/library.h b/lib/library.h index 2e878f11d..475e7cf3a 100644 --- a/lib/library.h +++ b/lib/library.h @@ -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 { diff --git a/test/testsuite.cpp b/test/testsuite.cpp index d080d4dc0..e267d63dd 100644 --- a/test/testsuite.cpp +++ b/test/testsuite.cpp @@ -270,7 +270,7 @@ std::size_t TestFixture::runTests(const options& args) if (!missingLibs.empty()) { std::cerr << "Missing libraries: "; - for (std::set::const_iterator i = missingLibs.cbegin(); i != missingLibs.cend(); ++i) + for (std::set::const_iterator i = missingLibs.begin(); i != missingLibs.end(); ++i) std::cerr << *i << " "; std::cerr << std::endl << std::endl; }