Compatibility fixes for gcc 4.5

This commit is contained in:
Daniel Marjamäki 2018-03-29 17:37:06 +02:00
parent 1bc8f7f29a
commit 96167ffa51
2 changed files with 4 additions and 3 deletions

View File

@ -1357,8 +1357,9 @@ void CheckBufferOverrun::checkStructVariable()
if (scope->nestedIn->isClassOrStruct())
continue;
std::vector<const std::string*> varname(2, nullptr);
varname[1] = &arrayInfo.varname();
std::vector<const std::string*> varname;
varname.push_back(NULL);
varname.push_back(&arrayInfo.varname());
// search the function and it's parameters
for (const Token *tok3 = func_scope->classDef; tok3 && tok3 != func_scope->classEnd; tok3 = tok3->next()) {

View File

@ -60,7 +60,7 @@ private:
inline bool endsWith(const std::string &str, char c)
{
return str.back() == c;
return str[str.size()-1U] == c;
}
inline bool endsWith(const std::string &str, const char end[], std::size_t endlen)