Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cli/cppcheckexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdio>
#include <cstdlib> // EXIT_SUCCESS and EXIT_FAILURE
#include <ctime>
Expand Down
1 change: 0 additions & 1 deletion cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
#include <cstdlib>
#include <exception>
#include <iostream>
#include <string>
#endif

/**
Expand Down
2 changes: 0 additions & 2 deletions cli/threadexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
#include <utility>
#include <vector>

enum class Color : std::uint8_t;

ThreadExecutor::ThreadExecutor(const std::list<FileWithDetails> &files, const std::list<FileSettings>& fileSettings, const Settings &settings, SuppressionList &suppressions, ErrorLogger &errorLogger, CppCheck::ExecuteCmdFn executeCommand)
: Executor(files, fileSettings, settings, suppressions, errorLogger)
, mExecuteCommand(std::move(executeCommand))
Expand Down
1 change: 0 additions & 1 deletion gui/codeeditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
class CodeEditorStyle;
class QPaintEvent;
class QRect;
class QResizeEvent;
class QTextDocument;

class Highlighter : public QSyntaxHighlighter {
Expand Down
2 changes: 0 additions & 2 deletions gui/csvreport.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#include <QString>
#include <QTextStream>

class ErrorItem;

/// @addtogroup GUI
/// @{

Expand Down
1 change: 0 additions & 1 deletion gui/helpdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <QVariant>

class QHelpEngine;
class QUrl;
class QWidget;
namespace Ui {
class HelpDialog;
Expand Down
1 change: 0 additions & 1 deletion gui/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class QSettings;
class QTimer;
class QLineEdit;
class ImportProject;
class QCloseEvent;
class QNetworkAccessManager;
class QNetworkReply;
class Settings;
Expand Down
1 change: 0 additions & 1 deletion gui/newsuppressiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <QStringList>

class QWidget;
enum class Color : std::uint8_t;

NewSuppressionDialog::NewSuppressionDialog(QWidget *parent) :
QDialog(parent),
Expand Down
2 changes: 0 additions & 2 deletions gui/printablereport.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

#include <QString>

class ErrorItem;

/// @addtogroup GUI
/// @{

Expand Down
2 changes: 0 additions & 2 deletions gui/resultstree.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ class QModelIndex;
class QWidget;
class QItemSelectionModel;
class ThreadHandler;
class QContextMenuEvent;
class QKeyEvent;
class QSettings;
enum class Severity : std::uint8_t;

Expand Down
1 change: 0 additions & 1 deletion gui/test/filelist/testfilelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/

#include <QObject>
#include <QString>

class TestFileList : public QObject {
Q_OBJECT
Expand Down
1 change: 1 addition & 0 deletions gui/test/projectfile/testprojectfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "testprojectfile.h"

#include "importproject.h"
#include "library.h"
#include "platform.h"
#include "projectfile.h"
#include "settings.h"
Expand Down
14 changes: 13 additions & 1 deletion gui/test/resultstree/testresultstree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,34 @@
*/

#include "testresultstree.h"

#include "resultstree.h"

// headers that declare mocked functions/variables
#include "applicationlist.h"
#include "common.h"
#include "threadhandler.h"
#include "projectfile.h"
#include "xmlreportv2.h"

#include "application.h"
#include "cppcheck.h"
#include "erroritem.h"
#include "errorlogger.h"
#include "errortypes.h"
#include "path.h"
#include "report.h"
#include "settings.h"
#include "showtypes.h"
#include "suppressions.h"
#include "xmlreport.h"

#include <cstddef>
#include <set>
#include <string>
#include <utility>

#include <QModelIndex>
#include <QString>
#include <QtTest>

class TestReport : public Report {
Expand Down
2 changes: 0 additions & 2 deletions gui/txtreport.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include <QObject>
#include <QTextStream>

class ErrorItem;

/// @addtogroup GUI
/// @{

Expand Down
1 change: 0 additions & 1 deletion lib/addoninfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <fstream>
#include <iostream>
#include <string>
#include <vector>

#include "json.h"

Expand Down
4 changes: 0 additions & 4 deletions lib/checkbufferoverrun.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
#include <string>
#include <vector>

namespace tinyxml2 {
class XMLElement;
}

class ErrorLogger;
class Settings;
class Token;
Expand Down
4 changes: 0 additions & 4 deletions lib/checkclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@

#include "xml.h"

namespace CTU {
class FileInfo;
}

//---------------------------------------------------------------------------

// Register CheckClass..
Expand Down
8 changes: 0 additions & 8 deletions lib/checkclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ class ErrorLogger;
class Settings;
class Token;

namespace CTU {
class FileInfo;
}

namespace tinyxml2 {
class XMLElement;
}

/// @addtogroup Checks
/// @{

Expand Down
1 change: 1 addition & 0 deletions lib/checkersreport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "checkersreport.h"

#include "addoninfo.h"
#include "checkers.h"
#include "errortypes.h"
#include "settings.h"
Expand Down
8 changes: 0 additions & 8 deletions lib/checknullpointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ class Library;
class Settings;
class Token;

namespace CTU {
class FileInfo;
}

namespace tinyxml2 {
class XMLElement;
}

/// @addtogroup Checks
/// @{

Expand Down
5 changes: 0 additions & 5 deletions lib/checkuninitvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@
#include <unordered_set>
#include <vector>


namespace tinyxml2 {
class XMLElement;
}

//---------------------------------------------------------------------------

// CWE ids used:
Expand Down
10 changes: 0 additions & 10 deletions lib/checkuninitvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "vfvalue.h"

#include <cstdint>
#include <list>
#include <map>
#include <set>
#include <string>
Expand All @@ -42,15 +41,6 @@ class ErrorLogger;
class Settings;
class Library;

namespace CTU {
class FileInfo;
}

namespace tinyxml2 {
class XMLElement;
}


struct VariableValue {
explicit VariableValue(MathLib::bigint val = 0) : value(val) {}
MathLib::bigint value;
Expand Down
2 changes: 0 additions & 2 deletions lib/infer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
#include <unordered_set>
#include <utility>

class Token;

template<class Predicate, class Compare>
static const ValueFlow::Value* getCompareValue(const std::list<ValueFlow::Value>& values, Predicate pred, Compare compare)
{
Expand Down
1 change: 0 additions & 1 deletion lib/library.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <set>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

class Token;
Expand Down
4 changes: 4 additions & 0 deletions lib/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
#include <unordered_set>
#include <utility>

#if defined(USE_WINDOWS_SEH) || defined(USE_UNIX_SIGNAL_HANDLING)
#include <cstdio>
#endif

enum class SHOWTIME_MODES : std::uint8_t;
namespace ValueFlow {
class Value;
Expand Down
1 change: 0 additions & 1 deletion lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
#include <numeric>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <unordered_set>
Expand Down
2 changes: 1 addition & 1 deletion lib/valueflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//---------------------------------------------------------------------------

#include "config.h"
#include "errortypes.h"
#include "mathlib.h"
#include "vfvalue.h"

Expand All @@ -33,7 +34,6 @@
#include <vector>

class ErrorLogger;
struct InferModel;
class Settings;
class SymbolDatabase;
class TimerResultsIntf;
Expand Down
1 change: 0 additions & 1 deletion lib/vf_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "vfvalue.h"

#include <cstddef>
#include <list>
#include <string>

class Token;
Expand Down
1 change: 1 addition & 0 deletions test/signal/test-signalhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <cassert>
#include <cfenv>
#include <cstdio>
#include <cstdlib>
#include <cstring>

Expand Down
2 changes: 1 addition & 1 deletion test/signal/test-signalhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_assert():
if sys.platform == "darwin":
assert stderr.startswith("Assertion failed: (false), function my_assert, file test-signalhandler.cpp, line "), stderr
else:
assert stderr.endswith("test-signalhandler.cpp:33: void my_assert(): Assertion `false' failed.\n"), stderr
assert stderr.endswith("test-signalhandler.cpp:34: void my_assert(): Assertion `false' failed.\n"), stderr
lines = stdout.splitlines()
assert lines[0] == 'Internal error: cppcheck received signal SIGABRT - abort or assertion'
# no stacktrace of MacOs
Expand Down
1 change: 1 addition & 0 deletions test/testvalueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "mathlib.h"
#include "platform.h"
#include "settings.h"
#include "standards.h"
#include "token.h"
#include "tokenize.h"
#include "vfvalue.h"
Expand Down