From 12c5980c017d2012edf8081b0e02e16cfe88c3b5 Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Fri, 18 May 2012 13:59:19 -0400 Subject: [PATCH 1/2] Fix compiler warning about initialization order --- lib/checkbufferoverrun.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 13b5e42d9..4c4894777 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -1872,7 +1872,7 @@ CheckBufferOverrun::ArrayInfo & CheckBufferOverrun::ArrayInfo::operator=(const C * this will not be needed as the declare can be used instead. */ CheckBufferOverrun::ArrayInfo::ArrayInfo(unsigned int id, const std::string &name, MathLib::bigint size1, MathLib::bigint n) - : _element_size(size1), _varid(id), _varname(name) + : _varname(name), _element_size(size1), _varid(id) { _num.push_back(n); } From 4686294d7e284fe1920621b8879e77b15ca2856c Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Fri, 18 May 2012 14:00:10 -0400 Subject: [PATCH 2/2] Fix compiler warning about empty for body --- lib/checkother.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 4c9f7e75f..922c3f504 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -595,7 +595,7 @@ void CheckOther::checkSizeofForPointerSize() // Jump to the next sizeof token in the function and in the parameter // This is to allow generic operations with sizeof - for (; tokVar && tokVar->str() != ")" && tokVar->str() != "," && tokVar->str() != "sizeof"; tokVar = tokVar->next()); + for (; tokVar && tokVar->str() != ")" && tokVar->str() != "," && tokVar->str() != "sizeof"; tokVar = tokVar->next()) {} // Now check for the sizeof usage. Once here, everything using sizeof(varid) // looks suspicious