Skip to content

Commit e016e77

Browse files
authored
Merge branch 'main' into fix-13633
2 parents 20bd755 + ca20e10 commit e016e77

208 files changed

Lines changed: 1146 additions & 724 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AUTHORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ Felix Wolff
131131
Florin Iucha
132132
Francesc Elies
133133
François Berder
134+
Frank Winklmeier
134135
Frank Zingsheim
135136
Frederik Schwarzer
136137
fu7mu4
@@ -257,6 +258,7 @@ Márton Csordás
257258
Masafumi Koba
258259
Massimo Paladin
259260
Mateusz Michalak
261+
Mateusz Patyk
260262
Mateusz Pusz
261263
Mathias De Maré
262264
Mathias Schmid
@@ -389,6 +391,7 @@ Thorsten Sick
389391
Tim Blume
390392
Tim Gerundt
391393
tititiou36
394+
Tobias Weber
392395
Tobias Weibel
393396
Tomasz Kłoczko
394397
Tom Pollok

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ TESTOBJ = test/fixture.o \
335335
test/testutils.o \
336336
test/testvaarg.o \
337337
test/testvalueflow.o \
338-
test/testvarid.o
338+
test/testvarid.o \
339+
test/testvfvalue.o
339340

340341
.PHONY: run-dmake tags
341342

@@ -900,6 +901,9 @@ test/testvalueflow.o: test/testvalueflow.cpp externals/simplecpp/simplecpp.h lib
900901
test/testvarid.o: test/testvarid.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
901902
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvarid.cpp
902903

904+
test/testvfvalue.o: test/testvfvalue.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h lib/vfvalue.h test/fixture.h
905+
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvfvalue.cpp
906+
903907
externals/simplecpp/simplecpp.o: externals/simplecpp/simplecpp.cpp externals/simplecpp/simplecpp.h
904908
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -w -c -o $@ externals/simplecpp/simplecpp.cpp
905909

cli/cmdlineparser.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Cppcheck - A tool for static C/C++ code analysis
3-
* Copyright (C) 2007-2024 Cppcheck team.
3+
* Copyright (C) 2007-2025 Cppcheck team.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -1168,6 +1168,10 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
11681168
// read underlying project
11691169
projectFile = projectFileGui;
11701170
projType = project.import(projectFileGui, &mSettings, &mSuppressions);
1171+
if (projType == ImportProject::Type::CPPCHECK_GUI) {
1172+
mLogger.printError("nested Cppcheck GUI projects are not supported.");
1173+
return Result::Fail;
1174+
}
11711175
}
11721176
}
11731177
if (projType == ImportProject::Type::VS_SLN || projType == ImportProject::Type::VS_VCXPROJ) {
@@ -1870,6 +1874,9 @@ void CmdLineParser::printHelp() const
18701874
" --rule=<rule> Match regular expression.\n"
18711875
" --rule-file=<file> Use given rule file. For more information, see:\n"
18721876
" http://sourceforge.net/projects/cppcheck/files/Articles/\n"
1877+
" --safety Enable safety-certified checking mode: display checker summary, enforce\n"
1878+
" stricter checks for critical errors, and return a non-zero exit code\n"
1879+
" if such errors occur.\n"
18731880
" --showtime=<mode> Show timing information.\n"
18741881
" The available modes are:\n"
18751882
" * none\n"

cli/cppcheckexecutor.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Cppcheck - A tool for static C/C++ code analysis
3-
* Copyright (C) 2007-2024 Cppcheck team.
3+
* Copyright (C) 2007-2025 Cppcheck team.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -440,8 +440,7 @@ int CppCheckExecutor::check_internal(const Settings& settings, Suppressions& sup
440440
if (!settings.checkersReportFilename.empty())
441441
std::remove(settings.checkersReportFilename.c_str());
442442

443-
CppCheck cppcheck(supprs, stdLogger, true, executeCommand);
444-
cppcheck.settings() = settings; // this is a copy
443+
CppCheck cppcheck(settings, supprs, stdLogger, true, executeCommand);
445444

446445
unsigned int returnValue = 0;
447446
if (settings.useSingleJob()) {

cli/cppcheckexecutor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- C++ -*-
22
* Cppcheck - A tool for static C/C++ code analysis
3-
* Copyright (C) 2007-2024 Cppcheck team.
3+
* Copyright (C) 2007-2025 Cppcheck team.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

cli/executor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Cppcheck - A tool for static C/C++ code analysis
3-
* Copyright (C) 2007-2024 Cppcheck team.
3+
* Copyright (C) 2007-2025 Cppcheck team.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

cli/executor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- C++ -*-
22
* Cppcheck - A tool for static C/C++ code analysis
3-
* Copyright (C) 2007-2024 Cppcheck team.
3+
* Copyright (C) 2007-2025 Cppcheck team.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

cli/filelister.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Cppcheck - A tool for static C/C++ code analysis
3-
* Copyright (C) 2007-2024 Cppcheck team.
3+
* Copyright (C) 2007-2025 Cppcheck team.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

cli/filelister.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- C++ -*-
22
* Cppcheck - A tool for static C/C++ code analysis
3-
* Copyright (C) 2007-2024 Cppcheck team.
3+
* Copyright (C) 2007-2025 Cppcheck team.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

cli/processexecutor.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Cppcheck - A tool for static C/C++ code analysis
3-
* Copyright (C) 2007-2024 Cppcheck team.
3+
* Copyright (C) 2007-2025 Cppcheck team.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -284,13 +284,12 @@ unsigned int ProcessExecutor::check()
284284
close(pipes[0]);
285285

286286
PipeWriter pipewriter(pipes[1]);
287-
CppCheck fileChecker(mSuppressions, pipewriter, false, mExecuteCommand);
288-
fileChecker.settings() = mSettings;
287+
CppCheck fileChecker(mSettings, mSuppressions, pipewriter, false, mExecuteCommand);
289288
unsigned int resultOfCheck = 0;
290289

291290
if (iFileSettings != mFileSettings.end()) {
292291
resultOfCheck = fileChecker.check(*iFileSettings);
293-
if (fileChecker.settings().clangTidy)
292+
if (mSettings.clangTidy)
294293
fileChecker.analyseClangTidy(*iFileSettings);
295294
} else {
296295
// Read file from a file

0 commit comments

Comments
 (0)