Compare commits
21 Commits
Author | SHA1 | Date |
---|---|---|
Daniel Marjamäki | 3e518e64d0 | |
Daniel Marjamäki | 800317aad0 | |
Daniel Marjamäki | db8d486ce4 | |
Daniel Marjamäki | f5f0c115a2 | |
Daniel Marjamäki | 051b1bb3fe | |
Paul Fultz II | c48f97e9cc | |
Daniel Marjamäki | 51c30cf270 | |
Daniel Marjamäki | 9eb8174d90 | |
Daniel Marjamäki | d1d60999ad | |
Daniel Marjamäki | 45a5ae6191 | |
Daniel Marjamäki | 328fa49981 | |
Daniel Marjamäki | 3b3ae419a7 | |
Daniel Marjamäki | d053f8ba23 | |
Daniel Marjamäki | 935c9349f3 | |
Daniel Marjamäki | 66a734b481 | |
Daniel Marjamäki | d873b8e771 | |
Paul Fultz II | 056a1b3313 | |
Paul Fultz II | 7836eb3663 | |
Daniel Marjamäki | 7a33de5aa5 | |
Daniel Marjamäki | 92cfdf2cb6 | |
Daniel Marjamäki | a7fc054a8e |
|
@ -34,6 +34,7 @@ jobs:
|
||||||
uses: microsoft/setup-msbuild@v1.0.2
|
uses: microsoft/setup-msbuild@v1.0.2
|
||||||
|
|
||||||
- name: Install PCRE
|
- name: Install PCRE
|
||||||
|
if: false
|
||||||
run: |
|
run: |
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel!
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel!
|
||||||
curl -fsSL https://ftp.pcre.org/pub/pcre/pcre-%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
|
curl -fsSL https://ftp.pcre.org/pub/pcre/pcre-%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
|
||||||
|
|
|
@ -29,6 +29,7 @@ jobs:
|
||||||
uses: microsoft/setup-msbuild@v1.0.2
|
uses: microsoft/setup-msbuild@v1.0.2
|
||||||
|
|
||||||
- name: Install PCRE
|
- name: Install PCRE
|
||||||
|
if: false
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL https://ftp.pcre.org/pub/pcre/pcre-8.44.zip -o pcre-8.44.zip
|
curl -fsSL https://ftp.pcre.org/pub/pcre/pcre-8.44.zip -o pcre-8.44.zip
|
||||||
7z x pcre-8.44.zip
|
7z x pcre-8.44.zip
|
||||||
|
@ -79,13 +80,29 @@ jobs:
|
||||||
del Build\gui\cppcheck-gui.pdb
|
del Build\gui\cppcheck-gui.pdb
|
||||||
|
|
||||||
- name: Build CLI x64 release configuration using MSBuild
|
- name: Build CLI x64 release configuration using MSBuild
|
||||||
run: msbuild -m cppcheck.sln /t:cli /p:Configuration=Release-PCRE /p:Platform=x64
|
run: msbuild -m cppcheck.sln /t:cli /p:Configuration=Release /p:Platform=x64
|
||||||
|
|
||||||
|
- name: Collect files
|
||||||
|
run: |
|
||||||
|
move Build\gui win_installer\files
|
||||||
|
mkdir win_installer\files\addons
|
||||||
|
copy addons\*.* win_installer\files\addons
|
||||||
|
mkdir win_installer\files\cfg
|
||||||
|
copy cfg\*.cfg win_installer\files\cfg
|
||||||
|
mkdir win_installer\files\platforms
|
||||||
|
copy platforms\*.xml win_installer\files\platforms
|
||||||
|
copy bin\cppcheck.exe win_installer\files
|
||||||
|
copy bin\cppcheck-core.dll win_installer\files
|
||||||
|
copy externals\z3\bin\libz3.dll win_installer\files
|
||||||
|
mkdir win_installer\files\help
|
||||||
|
xcopy /s gui\help win_installer\files\help
|
||||||
|
del win_installer\files\translations\*.qm
|
||||||
|
move gui\*.qm win_installer\files\translations
|
||||||
|
|
||||||
|
|
||||||
- name: Build Installer
|
- name: Build Installer
|
||||||
run: |
|
run: |
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
mkdir bin
|
|
||||||
xcopy /S Build\gui bin
|
|
||||||
cd win_installer
|
cd win_installer
|
||||||
REM Read ProductVersion
|
REM Read ProductVersion
|
||||||
for /f "tokens=4 delims= " %%a in ('find "ProductVersion" productInfo.wxi') do set PRODUCTVER=%%a
|
for /f "tokens=4 delims= " %%a in ('find "ProductVersion" productInfo.wxi') do set PRODUCTVER=%%a
|
||||||
|
@ -102,4 +119,4 @@ jobs:
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: deploy
|
name: deploy
|
||||||
path: Build\gui
|
path: win_installer\files
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -99,7 +99,7 @@ ifeq (clang++, $(findstring clang++,$(CXX)))
|
||||||
CPPCHK_GLIBCXX_DEBUG=
|
CPPCHK_GLIBCXX_DEBUG=
|
||||||
endif
|
endif
|
||||||
ifndef CXXFLAGS
|
ifndef CXXFLAGS
|
||||||
CXXFLAGS=-pedantic -Wall -Wextra -Wcast-qual -Wno-deprecated-declarations -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-shadow -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare -Wno-multichar $(CPPCHK_GLIBCXX_DEBUG) -g
|
CXXFLAGS=-std=c++0x -O2 -DNDEBUG -Wall -Wno-sign-compare
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Increase stack size for Cygwin builds to avoid segmentation fault in limited recursive tests.
|
# Increase stack size for Cygwin builds to avoid segmentation fault in limited recursive tests.
|
||||||
|
@ -316,7 +316,7 @@ dmake: tools/dmake.o cli/filelister.o $(libcppdir)/pathmatch.o $(libcppdir)/path
|
||||||
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
|
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
|
||||||
|
|
||||||
run-dmake: dmake
|
run-dmake: dmake
|
||||||
./dmake
|
./dmake --release
|
||||||
|
|
||||||
generate_cfg_tests: tools/generate_cfg_tests.o $(EXTOBJ)
|
generate_cfg_tests: tools/generate_cfg_tests.o $(EXTOBJ)
|
||||||
g++ -isystem externals/tinyxml2 -o generate_cfg_tests tools/generate_cfg_tests.o $(EXTOBJ)
|
g++ -isystem externals/tinyxml2 -o generate_cfg_tests tools/generate_cfg_tests.o $(EXTOBJ)
|
||||||
|
|
|
@ -608,13 +608,13 @@ class Variable:
|
||||||
self.access = element.get('access')
|
self.access = element.get('access')
|
||||||
self.scopeId = element.get('scope')
|
self.scopeId = element.get('scope')
|
||||||
self.scope = None
|
self.scope = None
|
||||||
self.isArgument = element.get('isArgument') == 'true'
|
self.isArgument = (self.access and self.access == 'Argument')
|
||||||
self.isArray = element.get('isArray') == 'true'
|
self.isArray = element.get('isArray') == 'true'
|
||||||
self.isClass = element.get('isClass') == 'true'
|
self.isClass = element.get('isClass') == 'true'
|
||||||
self.isConst = element.get('isConst') == 'true'
|
self.isConst = element.get('isConst') == 'true'
|
||||||
self.isGlobal = element.get('access') == 'Global'
|
self.isGlobal = (self.access and self.access == 'Global')
|
||||||
self.isExtern = element.get('isExtern') == 'true'
|
self.isExtern = element.get('isExtern') == 'true'
|
||||||
self.isLocal = element.get('isLocal') == 'true'
|
self.isLocal = (self.access and self.access == 'Local')
|
||||||
self.isPointer = element.get('isPointer') == 'true'
|
self.isPointer = element.get('isPointer') == 'true'
|
||||||
self.isReference = element.get('isReference') == 'true'
|
self.isReference = element.get('isReference') == 'true'
|
||||||
self.isStatic = element.get('isStatic') == 'true'
|
self.isStatic = element.get('isStatic') == 'true'
|
||||||
|
|
|
@ -121,6 +121,8 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[])
|
||||||
|
|
||||||
mSettings->exename = argv[0];
|
mSettings->exename = argv[0];
|
||||||
|
|
||||||
|
mSettings->loadCppcheckCfg(Path::getPathFromFilename(argv[0]) + "cppcheck.cfg");
|
||||||
|
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
if (argv[i][0] == '-') {
|
if (argv[i][0] == '-') {
|
||||||
// User define
|
// User define
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @mainpage Cppcheck
|
* @mainpage Cppcheck
|
||||||
* @version 2.5
|
* @version 2.6
|
||||||
*
|
*
|
||||||
* @section overview_sec Overview
|
* @section overview_sec Overview
|
||||||
* Cppcheck is a simple tool for static analysis of C/C++ code.
|
* Cppcheck is a simple tool for static analysis of C/C++ code.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Version for libraries CPP
|
# Version for libraries CPP
|
||||||
SET(VERSION "2.5.99")
|
SET(VERSION "2.6.3")
|
||||||
STRING(REGEX MATCHALL "[0-9]" VERSION_PARTS "${VERSION}")
|
STRING(REGEX MATCHALL "[0-9]" VERSION_PARTS "${VERSION}")
|
||||||
LIST(GET VERSION_PARTS 0 VERSION_MAJOR)
|
LIST(GET VERSION_PARTS 0 VERSION_MAJOR)
|
||||||
LIST(GET VERSION_PARTS 1 VERSION_MINOR)
|
LIST(GET VERSION_PARTS 1 VERSION_MINOR)
|
||||||
|
|
|
@ -508,6 +508,10 @@ void MainWindow::doAnalyzeFiles(const QStringList &files, const bool checkLibrar
|
||||||
checkSettings.checkLibrary = checkLibrary;
|
checkSettings.checkLibrary = checkLibrary;
|
||||||
checkSettings.checkConfiguration = checkConfiguration;
|
checkSettings.checkConfiguration = checkConfiguration;
|
||||||
|
|
||||||
|
const QString applicationFilePath = QCoreApplication::applicationFilePath();
|
||||||
|
const QString appPath = QFileInfo(applicationFilePath).canonicalPath();
|
||||||
|
checkSettings.loadCppcheckCfg(appPath.toStdString() + "/cppcheck.cfg");
|
||||||
|
|
||||||
if (mProjectFile)
|
if (mProjectFile)
|
||||||
qDebug() << "Checking project file" << mProjectFile->getFilename();
|
qDebug() << "Checking project file" << mProjectFile->getFilename();
|
||||||
|
|
||||||
|
@ -850,6 +854,9 @@ Settings MainWindow::getCppcheckSettings()
|
||||||
|
|
||||||
Settings result;
|
Settings result;
|
||||||
|
|
||||||
|
const QString applicationFilePath = QCoreApplication::applicationFilePath();
|
||||||
|
result.exename = applicationFilePath.toStdString();
|
||||||
|
|
||||||
const bool std = tryLoadLibrary(&result.library, "std.cfg");
|
const bool std = tryLoadLibrary(&result.library, "std.cfg");
|
||||||
bool posix = true;
|
bool posix = true;
|
||||||
if (result.posix())
|
if (result.posix())
|
||||||
|
|
|
@ -92,8 +92,15 @@ void ThreadHandler::check(const Settings &settings)
|
||||||
mRunningThreadCount = mResults.getFileCount();
|
mRunningThreadCount = mResults.getFileCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList addonsAndTools = mAddonsAndTools;
|
||||||
|
for (const std::string& addon: settings.addons) {
|
||||||
|
QString s = QString::fromStdString(addon);
|
||||||
|
if (!addonsAndTools.contains(s))
|
||||||
|
addonsAndTools << s;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < mRunningThreadCount; i++) {
|
for (int i = 0; i < mRunningThreadCount; i++) {
|
||||||
mThreads[i]->setAddonsAndTools(mAddonsAndTools);
|
mThreads[i]->setAddonsAndTools(addonsAndTools);
|
||||||
mThreads[i]->setSuppressions(mSuppressions);
|
mThreads[i]->setSuppressions(mSuppressions);
|
||||||
mThreads[i]->setClangIncludePaths(mClangIncludePaths);
|
mThreads[i]->setClangIncludePaths(mClangIncludePaths);
|
||||||
mThreads[i]->setDataDir(mDataDir);
|
mThreads[i]->setDataDir(mDataDir);
|
||||||
|
|
|
@ -68,9 +68,10 @@ static const CWE CWE398(398U); // Indicator of Poor Code Quality
|
||||||
namespace {
|
namespace {
|
||||||
struct AddonInfo {
|
struct AddonInfo {
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string scriptFile;
|
std::string scriptFile; // addon script
|
||||||
std::string args;
|
std::string executable; // addon executable
|
||||||
std::string python;
|
std::string args; // special extra arguments
|
||||||
|
std::string python; // script interpreter
|
||||||
bool ctu = false;
|
bool ctu = false;
|
||||||
std::string runScript{};
|
std::string runScript{};
|
||||||
|
|
||||||
|
@ -111,7 +112,7 @@ namespace {
|
||||||
if (obj.count("ctu")) {
|
if (obj.count("ctu")) {
|
||||||
// ctu is specified in the config file
|
// ctu is specified in the config file
|
||||||
if (!obj["ctu"].is<bool>())
|
if (!obj["ctu"].is<bool>())
|
||||||
return "Loading " + fileName + " failed. ctu must be array.";
|
return "Loading " + fileName + " failed. ctu must be boolean.";
|
||||||
ctu = obj["ctu"].get<bool>();
|
ctu = obj["ctu"].get<bool>();
|
||||||
} else {
|
} else {
|
||||||
ctu = false;
|
ctu = false;
|
||||||
|
@ -127,6 +128,13 @@ namespace {
|
||||||
python = "";
|
python = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (obj.count("executable")) {
|
||||||
|
if (!obj["executable"].is<std::string>())
|
||||||
|
return "Loading " + fileName + " failed. executable must be a string.";
|
||||||
|
executable = getFullPath(obj["executable"].get<std::string>(), fileName);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
return getAddonInfo(obj["script"].get<std::string>(), exename);
|
return getAddonInfo(obj["script"].get<std::string>(), exename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +281,9 @@ static std::string executeAddon(const AddonInfo &addonInfo,
|
||||||
|
|
||||||
std::string pythonExe;
|
std::string pythonExe;
|
||||||
|
|
||||||
if (!addonInfo.python.empty())
|
if (!addonInfo.executable.empty())
|
||||||
|
pythonExe = addonInfo.executable;
|
||||||
|
else if (!addonInfo.python.empty())
|
||||||
pythonExe = cmdFileName(addonInfo.python);
|
pythonExe = cmdFileName(addonInfo.python);
|
||||||
else if (!defaultPythonExe.empty())
|
else if (!defaultPythonExe.empty())
|
||||||
pythonExe = cmdFileName(defaultPythonExe);
|
pythonExe = cmdFileName(defaultPythonExe);
|
||||||
|
@ -294,9 +304,13 @@ static std::string executeAddon(const AddonInfo &addonInfo,
|
||||||
throw InternalError(nullptr, "Failed to auto detect python");
|
throw InternalError(nullptr, "Failed to auto detect python");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string args;
|
||||||
|
if (addonInfo.executable.empty())
|
||||||
|
args = cmdFileName(addonInfo.runScript) + " " + cmdFileName(addonInfo.scriptFile);
|
||||||
|
args += std::string(args.empty() ? "" : " ") + "--cli" + addonInfo.args;
|
||||||
|
|
||||||
const std::string fileArg = (endsWith(file, FILELIST, sizeof(FILELIST)-1) ? " --file-list " : " ") + cmdFileName(file);
|
const std::string fileArg = (endsWith(file, FILELIST, sizeof(FILELIST)-1) ? " --file-list " : " ") + cmdFileName(file);
|
||||||
const std::string args =
|
args += fileArg;
|
||||||
cmdFileName(addonInfo.runScript) + " " + cmdFileName(addonInfo.scriptFile) + " --cli" + addonInfo.args + fileArg;
|
|
||||||
|
|
||||||
std::string result;
|
std::string result;
|
||||||
if (!executeCommand(pythonExe, split(args), redirect, &result))
|
if (!executeCommand(pythonExe, split(args), redirect, &result))
|
||||||
|
@ -1347,13 +1361,23 @@ void CppCheck::executeAddons(const std::vector<std::string>& files)
|
||||||
|
|
||||||
picojson::object obj = res.get<picojson::object>();
|
picojson::object obj = res.get<picojson::object>();
|
||||||
|
|
||||||
const std::string fileName = obj["file"].get<std::string>();
|
|
||||||
const int64_t lineNumber = obj["linenr"].get<int64_t>();
|
|
||||||
const int64_t column = obj["column"].get<int64_t>();
|
|
||||||
|
|
||||||
ErrorMessage errmsg;
|
ErrorMessage errmsg;
|
||||||
|
|
||||||
errmsg.callStack.emplace_back(ErrorMessage::FileLocation(fileName, lineNumber, column));
|
if (obj.count("file") > 0) {
|
||||||
|
const std::string fileName = obj["file"].get<std::string>();
|
||||||
|
const int64_t lineNumber = obj["linenr"].get<int64_t>();
|
||||||
|
const int64_t column = obj["column"].get<int64_t>();
|
||||||
|
errmsg.callStack.emplace_back(ErrorMessage::FileLocation(fileName, lineNumber, column));
|
||||||
|
} else if (obj.count("loc") > 0) {
|
||||||
|
for (const picojson::value &locvalue: obj["loc"].get<picojson::array>()) {
|
||||||
|
picojson::object loc = locvalue.get<picojson::object>();
|
||||||
|
const std::string fileName = loc["file"].get<std::string>();
|
||||||
|
const int64_t lineNumber = loc["linenr"].get<int64_t>();
|
||||||
|
const int64_t column = loc["column"].get<int64_t>();
|
||||||
|
const std::string info = loc["info"].get<std::string>();
|
||||||
|
errmsg.callStack.emplace_back(ErrorMessage::FileLocation(fileName, info, lineNumber, column));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
errmsg.id = obj["addon"].get<std::string>() + "-" + obj["errorId"].get<std::string>();
|
errmsg.id = obj["addon"].get<std::string>() + "-" + obj["errorId"].get<std::string>();
|
||||||
const std::string text = obj["message"].get<std::string>();
|
const std::string text = obj["message"].get<std::string>();
|
||||||
|
@ -1362,11 +1386,14 @@ void CppCheck::executeAddons(const std::vector<std::string>& files)
|
||||||
errmsg.severity = Severity::fromString(severity);
|
errmsg.severity = Severity::fromString(severity);
|
||||||
if (errmsg.severity == Severity::SeverityType::none)
|
if (errmsg.severity == Severity::SeverityType::none)
|
||||||
continue;
|
continue;
|
||||||
errmsg.file0 = fileName;
|
errmsg.file0 = ((files.size() == 1) ? files[0] : "");
|
||||||
|
|
||||||
reportErr(errmsg);
|
reportErr(errmsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!fileList.empty())
|
||||||
|
std::remove(fileList.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppCheck::executeAddonsWholeProgram(const std::map<std::string, std::size_t> &files)
|
void CppCheck::executeAddonsWholeProgram(const std::map<std::string, std::size_t> &files)
|
||||||
|
@ -1381,6 +1408,10 @@ void CppCheck::executeAddonsWholeProgram(const std::map<std::string, std::size_t
|
||||||
}
|
}
|
||||||
|
|
||||||
executeAddons(ctuInfoFiles);
|
executeAddons(ctuInfoFiles);
|
||||||
|
|
||||||
|
for (const std::string &f: ctuInfoFiles) {
|
||||||
|
std::remove(f.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings &CppCheck::settings()
|
Settings &CppCheck::settings()
|
||||||
|
|
|
@ -17,9 +17,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
#include "path.h"
|
||||||
#include "summaries.h"
|
#include "summaries.h"
|
||||||
#include "valueflow.h"
|
#include "valueflow.h"
|
||||||
|
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
#define PICOJSON_USE_INT64
|
||||||
|
#include <picojson.h>
|
||||||
|
|
||||||
std::atomic<bool> Settings::mTerminated;
|
std::atomic<bool> Settings::mTerminated;
|
||||||
|
|
||||||
const char Settings::SafeChecks::XmlRootName[] = "safe-checks";
|
const char Settings::SafeChecks::XmlRootName[] = "safe-checks";
|
||||||
|
@ -70,6 +76,31 @@ Settings::Settings()
|
||||||
certainty.setEnabled(Certainty::normal, true);
|
certainty.setEnabled(Certainty::normal, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Settings::loadCppcheckCfg(const std::string &filename)
|
||||||
|
{
|
||||||
|
std::ifstream fin(filename);
|
||||||
|
if (!fin.is_open())
|
||||||
|
return;
|
||||||
|
picojson::value json;
|
||||||
|
fin >> json;
|
||||||
|
if (!picojson::get_last_error().empty())
|
||||||
|
return;
|
||||||
|
picojson::object obj = json.get<picojson::object>();
|
||||||
|
if (obj.count("addons") && obj["addons"].is<picojson::array>()) {
|
||||||
|
for (const picojson::value &v : obj["addons"].get<picojson::array>()) {
|
||||||
|
const std::string &s = v.get<std::string>();
|
||||||
|
if (!Path::isAbsolute(s))
|
||||||
|
addons.push_back(Path::getPathFromFilename(filename) + s);
|
||||||
|
else
|
||||||
|
addons.push_back(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (obj.count("suppressions") && obj["suppressions"].is<picojson::array>()) {
|
||||||
|
for (const picojson::value &v : obj["suppressions"].get<picojson::array>())
|
||||||
|
nomsg.addSuppressionLine(v.get<std::string>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string Settings::addEnabled(const std::string &str)
|
std::string Settings::addEnabled(const std::string &str)
|
||||||
{
|
{
|
||||||
// Enable parameters may be comma separated...
|
// Enable parameters may be comma separated...
|
||||||
|
|
|
@ -95,6 +95,8 @@ private:
|
||||||
public:
|
public:
|
||||||
Settings();
|
Settings();
|
||||||
|
|
||||||
|
void loadCppcheckCfg(const std::string &filename);
|
||||||
|
|
||||||
/** @brief addons, either filename of python/json file or json data */
|
/** @brief addons, either filename of python/json file or json data */
|
||||||
std::list<std::string> addons;
|
std::list<std::string> addons;
|
||||||
|
|
||||||
|
|
|
@ -3792,15 +3792,14 @@ void SymbolDatabase::printXml(std::ostream &out) const
|
||||||
out << " scope=\"" << var->scope() << '\"';
|
out << " scope=\"" << var->scope() << '\"';
|
||||||
if (var->valueType())
|
if (var->valueType())
|
||||||
out << " constness=\"" << var->valueType()->constness << '\"';
|
out << " constness=\"" << var->valueType()->constness << '\"';
|
||||||
out << " isArgument=\"" << var->isArgument() << '\"';
|
|
||||||
out << " isArray=\"" << var->isArray() << '\"';
|
out << " isArray=\"" << var->isArray() << '\"';
|
||||||
out << " isClass=\"" << var->isClass() << '\"';
|
out << " isClass=\"" << var->isClass() << '\"';
|
||||||
out << " isConst=\"" << var->isConst() << '\"';
|
out << " isConst=\"" << var->isConst() << '\"';
|
||||||
out << " isExtern=\"" << var->isExtern() << '\"';
|
out << " isExtern=\"" << var->isExtern() << '\"';
|
||||||
out << " isLocal=\"" << var->isLocal() << '\"';
|
|
||||||
out << " isPointer=\"" << var->isPointer() << '\"';
|
out << " isPointer=\"" << var->isPointer() << '\"';
|
||||||
out << " isReference=\"" << var->isReference() << '\"';
|
out << " isReference=\"" << var->isReference() << '\"';
|
||||||
out << " isStatic=\"" << var->isStatic() << '\"';
|
out << " isStatic=\"" << var->isStatic() << '\"';
|
||||||
|
out << " isVolatile=\"" << var->isVolatile() << '\"';
|
||||||
out << "/>" << std::endl;
|
out << "/>" << std::endl;
|
||||||
}
|
}
|
||||||
out << " </variables>" << std::endl;
|
out << " </variables>" << std::endl;
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
// After a release the DEVMINOR is incremented. MAJOR=x MINOR=y, DEVMINOR=y+1
|
// After a release the DEVMINOR is incremented. MAJOR=x MINOR=y, DEVMINOR=y+1
|
||||||
|
|
||||||
#define CPPCHECK_MAJOR 2
|
#define CPPCHECK_MAJOR 2
|
||||||
#define CPPCHECK_MINOR 5
|
#define CPPCHECK_MINOR 6
|
||||||
#define CPPCHECK_DEVMINOR 6
|
#define CPPCHECK_DEVMINOR 6
|
||||||
|
|
||||||
#define STRINGIFY(x) STRING(x)
|
#define STRINGIFY(x) STRING(x)
|
||||||
#define STRING(VER) #VER
|
#define STRING(VER) #VER
|
||||||
#if CPPCHECK_MINOR == CPPCHECK_DEVMINOR
|
#if CPPCHECK_MINOR == CPPCHECK_DEVMINOR
|
||||||
#define CPPCHECK_VERSION_STRING STRINGIFY(CPPCHECK_MAJOR) "." STRINGIFY(CPPCHECK_DEVMINOR)
|
#define CPPCHECK_VERSION_STRING STRINGIFY(CPPCHECK_MAJOR) "." STRINGIFY(CPPCHECK_DEVMINOR) ".3"
|
||||||
#define CPPCHECK_VERSION CPPCHECK_MAJOR,CPPCHECK_MINOR,0,0
|
#define CPPCHECK_VERSION CPPCHECK_MAJOR,CPPCHECK_MINOR,1,0
|
||||||
#else
|
#else
|
||||||
#define CPPCHECK_VERSION_STRING STRINGIFY(CPPCHECK_MAJOR) "." STRINGIFY(CPPCHECK_DEVMINOR) " dev"
|
#define CPPCHECK_VERSION_STRING STRINGIFY(CPPCHECK_MAJOR) "." STRINGIFY(CPPCHECK_DEVMINOR) " dev"
|
||||||
#define CPPCHECK_VERSION CPPCHECK_MAJOR,CPPCHECK_MINOR,99,0
|
#define CPPCHECK_VERSION CPPCHECK_MAJOR,CPPCHECK_MINOR,99,0
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: Cppcheck manual
|
title: Cppcheck manual
|
||||||
subtitle: Version 2.5
|
subtitle: Version 2.6
|
||||||
author: Cppcheck team
|
author: Cppcheck team
|
||||||
lang: en
|
lang: en
|
||||||
documentclass: report
|
documentclass: report
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: Cppcheck .cfg format
|
title: Cppcheck .cfg format
|
||||||
subtitle: Version 2.5
|
subtitle: Version 2.6
|
||||||
author: Cppcheck team
|
author: Cppcheck team
|
||||||
lang: en
|
lang: en
|
||||||
documentclass: report
|
documentclass: report
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
Color output for diagnostics are added for unix-based platforms.
|
||||||
|
|
||||||
|
Added symbolic analysis for ValueFlow. A simple delta is used to compute the difference between two unknown variable.
|
||||||
|
|
||||||
|
Rules using the "define" tokenlist can also match #include as well.
|
||||||
|
|
||||||
|
Library `<function>` tags can now use `<container>` tag, so free functions that accept containers such as `std::size`, `std::empty`, `std::begin`, `std::end`, etc. can specify the `yields` or `action` for the container.
|
||||||
|
|
||||||
|
Library `<smart-pointer>` tag can specify a `<unique>` tag for smart pointers that have unique ownership. Cppcheck now warns about dangling references to smart pointers with unique ownership.
|
||||||
|
|
||||||
|
Misra C 2012 compliance has been "completed"
|
||||||
|
|
||||||
|
All misra C 2012 rules have been implemented except 1.1 , 1.2 and 17.3. Including the rules in amendment 1 and amendment 2.
|
||||||
|
The rules 1.1 and 1.2 must be checked with a compiler.
|
||||||
|
The rule 17.3 can be checked by a compiler, for instance GCC.
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
pcre,https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz -H sha256:0b8e7465dc5e98c757cc3650a20a7843ee4c3edf50aaf60bb33fd879690d2c73
|
pcre,pfultz2/pcre@8.45 -H sha256:d6f7182602a775a7d500a0cedca6449af0400c6493951513046d17615ed0bf11
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Include>
|
<Include>
|
||||||
<?define CliBuildDir = "..\bin" ?>
|
<?define CliBuildDir = "files" ?>
|
||||||
<?define GuiBuildDir = "..\bin" ?>
|
<?define GuiBuildDir = "files" ?>
|
||||||
<?define GuiHelpDir = "..\gui\help" ?>
|
<?define GuiHelpDir = "files\help" ?>
|
||||||
<?define TranslationsDir = "..\gui" ?>
|
<?define TranslationsDir = "files\translations" ?>
|
||||||
<?define CfgsDir = "..\cfg" ?>
|
<?define CfgsDir = "files\cfg" ?>
|
||||||
<?define PtfsDir = "..\platforms" ?>
|
<?define PtfsDir = "files\platforms" ?>
|
||||||
<?define AddonsDir = "..\addons" ?>
|
<?define AddonsDir = "files\addons" ?>
|
||||||
<?define QtDllDir = "..\bin" ?>
|
<?define QtDllDir = "files" ?>
|
||||||
<?define Z3DllDir = "..\externals\z3\bin" ?>
|
<?define Z3DllDir = "files" ?>
|
||||||
|
|
||||||
<?if $(var.Platform) = x64 ?>
|
<?if $(var.Platform) = x64 ?>
|
||||||
<?define CrtMergeModule = "$(env.VCToolsRedistDir)\MergeModules\Microsoft_VC142_CRT_x64.msm" ?>
|
<?define CrtMergeModule = "$(env.VCToolsRedistDir)\MergeModules\Microsoft_VC142_CRT_x64.msm" ?>
|
||||||
|
|
|
@ -40,6 +40,6 @@
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="Validate">
|
<Target Name="Validate">
|
||||||
<Exec Command="..\bin\cppcheck --rule=. --version" />
|
<Exec Command="..\bin\cppcheck --version" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Include>
|
<Include>
|
||||||
<?define ProductName = "Cppcheck $(var.Platform) 2.5 dev" ?>
|
<?define ProductName = "Cppcheck $(var.Platform) 2.6.3" ?>
|
||||||
<?define ProductNameShort = "Cppcheck" ?>
|
<?define ProductNameShort = "Cppcheck" ?>
|
||||||
<?define ProductVersion = "2.5.99" ?>
|
<?define ProductVersion = "2.6.3" ?>
|
||||||
|
|
||||||
<?define ProductManufacturer = "The Cppcheck team" ?>
|
<?define ProductManufacturer = "The Cppcheck team" ?>
|
||||||
<?define ProductDescription = "Cppcheck is a tool for static analysis of C/C++ code" ?>
|
<?define ProductDescription = "Cppcheck is a tool for static analysis of C/C++ code" ?>
|
||||||
|
|
Loading…
Reference in New Issue