Skip to content

Commit 3419e1b

Browse files
committed
Merge branch 'main' of https://github.com/danmar/cppcheck into swap-error-message-arg-order
2 parents 365fed1 + 2b51b48 commit 3419e1b

5 files changed

Lines changed: 7 additions & 5 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ ifeq (clang++, $(findstring clang++,$(CXX)))
132132
CPPCHK_GLIBCXX_DEBUG=
133133
endif
134134
ifndef CXXFLAGS
135-
CXXFLAGS=-pedantic -Wall -Wextra -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-sign-compare -Wno-multichar -Woverloaded-virtual $(CPPCHK_GLIBCXX_DEBUG) -g
135+
CXXFLAGS=-pedantic -Wall -Wextra -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-sign-compare -Wno-multichar -Woverloaded-virtual -g
136136
endif
137137

138138
ifeq (g++, $(findstring g++,$(CXX)))

lib/importproject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void ImportProject::fsSetDefines(FileSettings& fs, std::string defs)
7979
while (!defs.empty() && defs[0] == ';')
8080
defs.erase(0, 1);
8181
while (!defs.empty() && endsWith(defs,';'))
82-
defs.erase(defs.size() - 1U); // TODO: Use std::string::pop_back() as soon as travis supports it
82+
defs.pop_back();
8383
bool eq = false;
8484
for (std::size_t pos = 0; pos < defs.size(); ++pos) {
8585
if (defs[pos] == '(' || defs[pos] == '=')

lib/programmemory.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ std::size_t ExprIdToken::Hash::operator()(ExprIdToken etok) const
6161
void ProgramMemory::setValue(const Token* expr, const ValueFlow::Value& value) {
6262
copyOnWrite();
6363

64-
(*mValues)[expr] = value;
6564
ValueFlow::Value subvalue = value;
6665
const Token* subexpr = solveExprValue(
6766
expr,
@@ -74,6 +73,8 @@ void ProgramMemory::setValue(const Token* expr, const ValueFlow::Value& value) {
7473
return {};
7574
},
7675
subvalue);
76+
if (expr != subexpr)
77+
(*mValues)[expr] = value;
7778
if (subexpr)
7879
(*mValues)[subexpr] = std::move(subvalue);
7980
}

tools/bisect/bisect_common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def build_cppcheck(bisect_path):
3333
# TODO: use "make install"?
3434
# TODO: use CXXOPTS overrides to workaround compiling issues in older versions
3535
print('building {}'.format(commit_hash))
36-
subprocess.check_call(['make', '-C', bisect_repo_dir, '-j6', 'MATCHCOMPILER=yes', 'CXXOPTS=-O2 -w -pipe', '-s'])
36+
# we always need to use CXXFLAGS because we need to support older versions
37+
subprocess.check_call(['make', '-C', bisect_repo_dir, '-j6', 'MATCHCOMPILER=yes', 'CXXFLAGS=-O2 -w -pipe', '-s'])
3738

3839
# TODO: remove folder if installation failed
3940
print('installing {}'.format(commit_hash))

tools/dmake/dmake.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ int main(int argc, char **argv)
725725
"-Wno-sign-compare "
726726
"-Wno-multichar "
727727
"-Woverloaded-virtual "
728-
"$(CPPCHK_GLIBCXX_DEBUG) "
728+
//"$(CPPCHK_GLIBCXX_DEBUG) " // TODO: when using CXXOPTS this would always be set - need to handle this differently
729729
"-g");
730730
}
731731

0 commit comments

Comments
 (0)