From 171da2e6f9ca3de992f91ba6095acd3e1c817873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Thu, 27 Jan 2022 19:03:20 +0100 Subject: [PATCH] avoid dependency on transitive includes - based on include-what-you-use (#3757) --- cli/cmdlineparser.cpp | 2 ++ cli/cppcheckexecutor.cpp | 5 +++++ cli/cppcheckexecutor.h | 3 +++ cli/main.cpp | 5 +++++ cli/threadexecutor.cpp | 2 ++ lib/astutils.cpp | 5 +++++ lib/bughuntingchecks.cpp | 13 ++++++++++++ lib/check.cpp | 2 ++ lib/check64bit.cpp | 2 ++ lib/checkassert.cpp | 1 + lib/checkautovariables.cpp | 4 ++++ lib/checkautovariables.h | 4 ++++ lib/checkbool.cpp | 3 +++ lib/checkboost.cpp | 3 +++ lib/checkbufferoverrun.cpp | 2 ++ lib/checkbufferoverrun.h | 1 + lib/checkclass.cpp | 15 ++++++++++++-- lib/checkclass.h | 12 ++++++++++- lib/checkcondition.cpp | 5 +++++ lib/checkcondition.h | 4 ++++ lib/checkexceptionsafety.cpp | 3 +++ lib/checkfunctions.cpp | 2 ++ lib/checkfunctions.h | 3 ++- lib/checkio.cpp | 4 ++++ lib/checkleakautovar.cpp | 2 ++ lib/checkleakautovar.h | 1 + lib/checkmemoryleak.cpp | 2 ++ lib/checkmemoryleak.h | 1 + lib/checknullpointer.cpp | 5 +++++ lib/checknullpointer.h | 3 +++ lib/checkother.cpp | 11 ++++++++--- lib/checkpostfixoperator.cpp | 3 +++ lib/checksizeof.cpp | 4 ++++ lib/checkstl.cpp | 8 +++++++- lib/checkstring.cpp | 1 + lib/checktype.cpp | 5 +++++ lib/checktype.h | 4 ++++ lib/checkuninitvar.cpp | 8 +++++++- lib/checkuninitvar.h | 7 +++++++ lib/checkunusedfunctions.cpp | 14 ++++++++++++- lib/checkunusedfunctions.h | 4 ++++ lib/checkunusedvar.cpp | 5 +++++ lib/checkunusedvar.h | 1 + lib/checkvaarg.cpp | 2 ++ lib/clangimport.cpp | 22 ++++++++++++++++----- lib/color.cpp | 2 ++ lib/cppcheck.cpp | 34 ++++++++++++++++++++++---------- lib/cppcheck.h | 2 ++ lib/ctu.cpp | 11 ++++++++++- lib/ctu.h | 14 +++++++++++++ lib/errorlogger.cpp | 8 +++++--- lib/errorlogger.h | 1 + lib/errortypes.h | 1 + lib/exprengine.cpp | 17 ++++++++++++++-- lib/exprengine.h | 3 +++ lib/forwardanalyzer.cpp | 9 +++++++++ lib/importproject.cpp | 13 +++++++++--- lib/importproject.h | 1 + lib/infer.cpp | 9 +++++++++ lib/infer.h | 8 ++++++-- lib/library.cpp | 7 ++++++- lib/mathlib.cpp | 5 +++-- lib/pathanalysis.cpp | 5 +++++ lib/pathanalysis.h | 2 ++ lib/platform.cpp | 6 +++++- lib/preprocessor.cpp | 7 ++++++- lib/programmemory.cpp | 8 ++++++++ lib/reverseanalyzer.cpp | 7 +++++++ lib/settings.h | 3 +++ lib/summaries.cpp | 2 ++ lib/suppressions.cpp | 6 ++++-- lib/suppressions.h | 1 + lib/symboldatabase.cpp | 5 +++++ lib/symboldatabase.h | 3 +++ lib/templatesimplifier.cpp | 4 ++++ lib/token.cpp | 6 ++++++ lib/token.h | 5 ++++- lib/tokenize.cpp | 10 ++++++++++ lib/tokenize.h | 4 ++++ lib/tokenlist.cpp | 9 +++++++-- lib/tokenlist.h | 2 ++ lib/utils.cpp | 6 ++++-- lib/valueflow.cpp | 5 +++++ lib/valueflow.h | 2 ++ test/test64bit.cpp | 3 +++ test/testassert.cpp | 4 ++++ test/testastutils.cpp | 3 +++ test/testautovariables.cpp | 3 +++ test/testbool.cpp | 3 +++ test/testboost.cpp | 3 +++ test/testbufferoverrun.cpp | 10 +++++++++- test/testbughuntingchecks.cpp | 5 +++++ test/testcharvar.cpp | 3 +++ test/testclangimport.cpp | 10 ++++++++++ test/testclass.cpp | 12 +++++++++-- test/testcmdlineparser.cpp | 2 ++ test/testcondition.cpp | 12 +++++++++-- test/testconstructors.cpp | 7 +++++++ test/testcppcheck.cpp | 2 ++ test/testerrorlogger.cpp | 5 ++++- test/testexceptionsafety.cpp | 3 +++ test/testexprengine.cpp | 5 +++++ test/testfilelister.cpp | 3 +++ test/testfunctions.cpp | 9 +++++++-- test/testgarbage.cpp | 5 +++++ test/testimportproject.cpp | 4 ++++ test/testincompletestatement.cpp | 8 +++++++- test/testio.cpp | 4 ++++ test/testleakautovar.cpp | 15 ++++++++++++-- test/testlibrary.cpp | 7 ++++++- test/testmathlib.cpp | 2 ++ test/testmemleak.cpp | 8 ++++++++ test/testnullpointer.cpp | 7 ++++++- test/testoptions.cpp | 4 ++++ test/testother.cpp | 12 +++++++++-- test/testpath.cpp | 1 + test/testpathmatch.cpp | 1 + test/testpostfixoperator.cpp | 3 +++ test/testpreprocessor.cpp | 8 +++++++- test/testrunner.cpp | 4 ++++ test/testsimplifytemplate.cpp | 5 +++++ test/testsimplifytokens.cpp | 5 ++++- test/testsimplifytypedef.cpp | 7 +++++++ test/testsimplifyusing.cpp | 4 ++++ test/testsizeof.cpp | 8 +++++++- test/teststl.cpp | 3 +++ test/teststring.cpp | 4 ++++ test/testsuite.h | 1 + test/testsummaries.cpp | 7 +++++-- test/testsuppressions.cpp | 6 ++++++ test/testsymboldatabase.cpp | 6 +++++- test/testthreadexecutor.cpp | 3 +++ test/testtimer.cpp | 1 + test/testtoken.cpp | 4 ++++ test/testtokenize.cpp | 5 +++++ test/testtokenlist.cpp | 2 ++ test/testtokenrange.cpp | 5 +++++ test/testtype.cpp | 4 ++++ test/testuninitvar.cpp | 5 +++++ test/testunusedfunctions.cpp | 3 +++ test/testunusedprivfunc.cpp | 8 +++++++- test/testunusedvar.cpp | 4 ++++ test/testutils.h | 7 +++++++ test/testvaarg.cpp | 3 +++ test/testvalueflow.cpp | 9 ++++++++- test/testvarid.cpp | 3 +++ 146 files changed, 722 insertions(+), 71 deletions(-) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 757583bc9..be3119720 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -20,6 +20,7 @@ #include "check.h" #include "cppcheckexecutor.h" +#include "errortypes.h" #include "filelister.h" #include "importproject.h" #include "path.h" @@ -32,6 +33,7 @@ #include "utils.h" #include +#include #include #include // EXIT_FAILURE #include diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index fd47d59c4..6e79362d0 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -23,6 +23,7 @@ #include "color.h" #include "config.h" #include "cppcheck.h" +#include "errortypes.h" #include "filelister.h" #include "importproject.h" #include "library.h" @@ -35,13 +36,17 @@ #include "utils.h" #include "checkunusedfunctions.h" +#include +#include #include #include #include // EXIT_SUCCESS and EXIT_FAILURE #include +#include #include #include #include +#include #include #include diff --git a/cli/cppcheckexecutor.h b/cli/cppcheckexecutor.h index 9a17d478b..4c46955af 100644 --- a/cli/cppcheckexecutor.h +++ b/cli/cppcheckexecutor.h @@ -20,13 +20,16 @@ #define CPPCHECKEXECUTOR_H #include "color.h" +#include "config.h" #include "errorlogger.h" #include #include +#include #include #include #include +#include class CppCheck; class Library; diff --git a/cli/main.cpp b/cli/main.cpp index 06bb945ef..f8a89420b 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -59,8 +59,13 @@ */ +#include "errortypes.h" #include "cppcheckexecutor.h" +#include +#include +#include + #ifdef NDEBUG #include #endif diff --git a/cli/threadexecutor.cpp b/cli/threadexecutor.cpp index 699905bc9..90fd43aac 100644 --- a/cli/threadexecutor.cpp +++ b/cli/threadexecutor.cpp @@ -22,6 +22,7 @@ #include "config.h" #include "cppcheck.h" #include "cppcheckexecutor.h" +#include "errortypes.h" #include "importproject.h" #include "settings.h" #include "suppressions.h" @@ -30,6 +31,7 @@ #include #include #include +#include #include #include diff --git a/lib/astutils.cpp b/lib/astutils.cpp index 0a7cd80b9..8df5aadb3 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -33,10 +33,15 @@ #include #include +#include #include #include +#include +#include #include #include +#include +#include #include template )> diff --git a/lib/bughuntingchecks.cpp b/lib/bughuntingchecks.cpp index aec4616bc..58512528b 100644 --- a/lib/bughuntingchecks.cpp +++ b/lib/bughuntingchecks.cpp @@ -17,12 +17,25 @@ */ #include "bughuntingchecks.h" + #include "astutils.h" #include "errorlogger.h" +#include "errortypes.h" +#include "library.h" +#include "mathlib.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" +#include "utils.h" +#include "valueflow.h" + +#include #include +#include +#include +#include +#include +#include static const CWE CWE_BUFFER_UNDERRUN(786U); // Access of Memory Location Before Start of Buffer static const CWE CWE_BUFFER_OVERRUN(788U); // Access of Memory Location After End of Buffer diff --git a/lib/check.cpp b/lib/check.cpp index d53758d1f..38b4ade4e 100644 --- a/lib/check.cpp +++ b/lib/check.cpp @@ -22,7 +22,9 @@ #include "errorlogger.h" #include "settings.h" +#include "token.h" #include "tokenize.h" +#include "valueflow.h" #include #include diff --git a/lib/check64bit.cpp b/lib/check64bit.cpp index 73d858b86..ecb38df1b 100644 --- a/lib/check64bit.cpp +++ b/lib/check64bit.cpp @@ -22,11 +22,13 @@ #include "check64bit.h" +#include "errortypes.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" #include "tokenize.h" +#include //--------------------------------------------------------------------------- diff --git a/lib/checkassert.cpp b/lib/checkassert.cpp index ab284676d..b640663f4 100644 --- a/lib/checkassert.cpp +++ b/lib/checkassert.cpp @@ -22,6 +22,7 @@ #include "checkassert.h" +#include "errortypes.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" diff --git a/lib/checkautovariables.cpp b/lib/checkautovariables.cpp index cd215964b..4b74eee12 100644 --- a/lib/checkautovariables.cpp +++ b/lib/checkautovariables.cpp @@ -28,10 +28,14 @@ #include "symboldatabase.h" #include "token.h" #include "tokenize.h" +#include "utils.h" #include "valueflow.h" #include #include +#include +#include +#include //--------------------------------------------------------------------------- diff --git a/lib/checkautovariables.h b/lib/checkautovariables.h index 86141a99f..b609c6e09 100644 --- a/lib/checkautovariables.h +++ b/lib/checkautovariables.h @@ -34,6 +34,10 @@ class Tokenizer; class ErrorLogger; class Variable; +namespace ValueFlow { + class Value; +} + /// @addtogroup Checks /** @brief Various small checks for automatic variables */ /// @{ diff --git a/lib/checkbool.cpp b/lib/checkbool.cpp index d2f2868d1..3c49d08f3 100644 --- a/lib/checkbool.cpp +++ b/lib/checkbool.cpp @@ -21,12 +21,15 @@ #include "checkbool.h" #include "astutils.h" +#include "errortypes.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" #include "tokenize.h" +#include "valueflow.h" #include +#include //--------------------------------------------------------------------------- // Register this check class (by creating a static instance of it) diff --git a/lib/checkboost.cpp b/lib/checkboost.cpp index 5d2bdba7f..cc1996e56 100644 --- a/lib/checkboost.cpp +++ b/lib/checkboost.cpp @@ -18,9 +18,12 @@ #include "checkboost.h" +#include "errortypes.h" #include "symboldatabase.h" #include "token.h" +#include + // Register this check class (by creating a static instance of it) namespace { CheckBoost instance; diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index ec1102aaf..dff14078b 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -35,7 +35,9 @@ #include #include +#include #include +#include #include // std::accumulate #include #include diff --git a/lib/checkbufferoverrun.h b/lib/checkbufferoverrun.h index 7f02f3457..aede08fb3 100644 --- a/lib/checkbufferoverrun.h +++ b/lib/checkbufferoverrun.h @@ -28,6 +28,7 @@ #include "errortypes.h" #include "mathlib.h" #include "symboldatabase.h" +#include "utils.h" #include "valueflow.h" #include diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 03c2a435d..c4eb5be85 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -26,15 +26,26 @@ #include "symboldatabase.h" #include "errorlogger.h" #include "errortypes.h" +#include "mathlib.h" #include "token.h" #include "tokenize.h" +#include "tokenlist.h" #include "utils.h" -#include "tinyxml2.h" - #include +#include #include +#include +#include #include +#include + +#include + +namespace CTU { + class FileInfo; +} + //--------------------------------------------------------------------------- // Register CheckClass.. diff --git a/lib/checkclass.h b/lib/checkclass.h index 377ed14ad..8c4b01131 100644 --- a/lib/checkclass.h +++ b/lib/checkclass.h @@ -23,9 +23,11 @@ #include "check.h" #include "config.h" -#include "tokenize.h" #include "symboldatabase.h" +#include "tokenize.h" +#include "utils.h" +#include #include #include #include @@ -36,6 +38,14 @@ class ErrorLogger; class Settings; class Token; +namespace CTU { + class FileInfo; +} + +namespace tinyxml2 { + class XMLElement; +} + /// @addtogroup Checks /// @{ diff --git a/lib/checkcondition.cpp b/lib/checkcondition.cpp index 790e52207..78dd160e7 100644 --- a/lib/checkcondition.cpp +++ b/lib/checkcondition.cpp @@ -23,6 +23,8 @@ #include "checkcondition.h" #include "astutils.h" +#include "library.h" +#include "platform.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" @@ -34,8 +36,11 @@ #include #include #include +#include +#include #include #include +#include // CWE ids used static const struct CWE uncheckedErrorConditionCWE(391U); diff --git a/lib/checkcondition.h b/lib/checkcondition.h index 964b1d67a..55821e309 100644 --- a/lib/checkcondition.h +++ b/lib/checkcondition.h @@ -37,6 +37,10 @@ class Tokenizer; class ErrorLogger; class ValueType; +namespace ValueFlow { + class Value; +} + /// @addtogroup Checks /// @{ diff --git a/lib/checkexceptionsafety.cpp b/lib/checkexceptionsafety.cpp index e2d13f5fe..fc6da7ced 100644 --- a/lib/checkexceptionsafety.cpp +++ b/lib/checkexceptionsafety.cpp @@ -21,9 +21,12 @@ #include "settings.h" #include "symboldatabase.h" +#include "token.h" +#include #include #include +#include //--------------------------------------------------------------------------- diff --git a/lib/checkfunctions.cpp b/lib/checkfunctions.cpp index 4ac614610..d248155fa 100644 --- a/lib/checkfunctions.cpp +++ b/lib/checkfunctions.cpp @@ -31,6 +31,8 @@ #include "valueflow.h" #include +#include +#include #include //--------------------------------------------------------------------------- diff --git a/lib/checkfunctions.h b/lib/checkfunctions.h index b870f921b..fd9ffd367 100644 --- a/lib/checkfunctions.h +++ b/lib/checkfunctions.h @@ -24,9 +24,10 @@ #include "check.h" #include "config.h" +#include "errortypes.h" #include "library.h" #include "settings.h" -#include "errortypes.h" +#include "utils.h" #include #include diff --git a/lib/checkio.cpp b/lib/checkio.cpp index ce2634bb1..186f1d27c 100644 --- a/lib/checkio.cpp +++ b/lib/checkio.cpp @@ -28,11 +28,15 @@ #include "utils.h" #include "valueflow.h" +#include #include #include +#include #include #include +#include #include +#include #include #include diff --git a/lib/checkleakautovar.cpp b/lib/checkleakautovar.cpp index b7435ce6d..cbd91a6f0 100644 --- a/lib/checkleakautovar.cpp +++ b/lib/checkleakautovar.cpp @@ -34,7 +34,9 @@ #include #include +#include #include +#include //--------------------------------------------------------------------------- diff --git a/lib/checkleakautovar.h b/lib/checkleakautovar.h index 3fd573121..ee5d3e7f2 100644 --- a/lib/checkleakautovar.h +++ b/lib/checkleakautovar.h @@ -30,6 +30,7 @@ #include #include #include +#include class ErrorLogger; class Settings; diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 2cf931103..6dc4dd317 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -29,6 +29,8 @@ #include "utils.h" #include +#include +#include //--------------------------------------------------------------------------- diff --git a/lib/checkmemoryleak.h b/lib/checkmemoryleak.h index 6b3795ec8..474a57fde 100644 --- a/lib/checkmemoryleak.h +++ b/lib/checkmemoryleak.h @@ -36,6 +36,7 @@ #include "config.h" #include "errortypes.h" #include "tokenize.h" +#include "utils.h" #include #include diff --git a/lib/checknullpointer.cpp b/lib/checknullpointer.cpp index 622710ffb..c6044d965 100644 --- a/lib/checknullpointer.cpp +++ b/lib/checknullpointer.cpp @@ -22,6 +22,7 @@ #include "astutils.h" #include "errorlogger.h" +#include "errortypes.h" #include "library.h" #include "mathlib.h" #include "settings.h" @@ -31,7 +32,11 @@ #include #include +#include +#include #include +#include + //--------------------------------------------------------------------------- // Register this check class (by creating a static instance of it) diff --git a/lib/checknullpointer.h b/lib/checknullpointer.h index 60002d339..144394192 100644 --- a/lib/checknullpointer.h +++ b/lib/checknullpointer.h @@ -36,6 +36,9 @@ class Settings; class Token; class Tokenizer; +namespace tinyxml2 { + class XMLElement; +} /// @addtogroup Checks /// @{ diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 6e66589e9..c99b1a62d 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -20,8 +20,6 @@ //--------------------------------------------------------------------------- #include "checkother.h" -#include "checkuninitvar.h" // CheckUninitVar::isVariableUsage - #include "astutils.h" #include "library.h" #include "mathlib.h" @@ -33,11 +31,18 @@ #include "utils.h" #include "valueflow.h" +#include "checkuninitvar.h" // CheckUninitVar::isVariableUsage + #include // find_if() +#include #include #include +#include +#include +#include +#include #include -#include + //--------------------------------------------------------------------------- // Register this check class (by creating a static instance of it) diff --git a/lib/checkpostfixoperator.cpp b/lib/checkpostfixoperator.cpp index fa5fffabc..4f29a5b85 100644 --- a/lib/checkpostfixoperator.cpp +++ b/lib/checkpostfixoperator.cpp @@ -23,10 +23,13 @@ #include "checkpostfixoperator.h" +#include "errortypes.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" +#include + //--------------------------------------------------------------------------- diff --git a/lib/checksizeof.cpp b/lib/checksizeof.cpp index 78285648d..d9393f090 100644 --- a/lib/checksizeof.cpp +++ b/lib/checksizeof.cpp @@ -20,11 +20,15 @@ //--------------------------------------------------------------------------- #include "checksizeof.h" +#include "errortypes.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" #include "tokenize.h" +#include +#include + //--------------------------------------------------------------------------- // Register this check class (by creating a static instance of it) diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index c636113f0..a172ee621 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -20,7 +20,6 @@ #include "astutils.h" #include "check.h" -#include "checknullpointer.h" #include "errortypes.h" #include "library.h" #include "mathlib.h" @@ -33,14 +32,21 @@ #include "utils.h" #include "valueflow.h" +#include "checknullpointer.h" + #include +#include #include #include #include +#include #include #include +#include +#include #include #include +#include // Register this check class (by creating a static instance of it) namespace { diff --git a/lib/checkstring.cpp b/lib/checkstring.cpp index e81a3ecde..80593e1e6 100644 --- a/lib/checkstring.cpp +++ b/lib/checkstring.cpp @@ -21,6 +21,7 @@ #include "checkstring.h" #include "astutils.h" +#include "errortypes.h" #include "mathlib.h" #include "settings.h" #include "symboldatabase.h" diff --git a/lib/checktype.cpp b/lib/checktype.cpp index bf4921e61..63a0a1f4f 100644 --- a/lib/checktype.cpp +++ b/lib/checktype.cpp @@ -20,15 +20,20 @@ //--------------------------------------------------------------------------- #include "checktype.h" +#include "errortypes.h" #include "mathlib.h" #include "platform.h" #include "settings.h" +#include "standards.h" #include "symboldatabase.h" #include "token.h" #include "tokenize.h" #include #include +#include +#include + //--------------------------------------------------------------------------- // Register this check class (by creating a static instance of it) diff --git a/lib/checktype.h b/lib/checktype.h index 5e31065e4..441e586d5 100644 --- a/lib/checktype.h +++ b/lib/checktype.h @@ -26,10 +26,14 @@ #include "config.h" #include "valueflow.h" +#include +#include + class ErrorLogger; class Settings; class Token; class Tokenizer; +class ValueType; /// @addtogroup Checks /// @{ diff --git a/lib/checkuninitvar.cpp b/lib/checkuninitvar.cpp index c6645bf5a..57b070b9a 100644 --- a/lib/checkuninitvar.cpp +++ b/lib/checkuninitvar.cpp @@ -21,7 +21,6 @@ #include "checkuninitvar.h" #include "astutils.h" -#include "checknullpointer.h" // CheckNullPointer::isPointerDeref #include "errorlogger.h" #include "library.h" #include "mathlib.h" @@ -31,10 +30,17 @@ #include "tokenize.h" #include "valueflow.h" +#include "checknullpointer.h" // CheckNullPointer::isPointerDeref + +#include #include +#include +#include #include #include +#include #include +#include namespace tinyxml2 { diff --git a/lib/checkuninitvar.h b/lib/checkuninitvar.h index 245f649fd..e9e3254b4 100644 --- a/lib/checkuninitvar.h +++ b/lib/checkuninitvar.h @@ -28,7 +28,10 @@ #include "mathlib.h" #include "errortypes.h" #include "utils.h" +#include "valueflow.h" +#include +#include #include #include @@ -40,6 +43,10 @@ class ErrorLogger; class Settings; class Library; +namespace tinyxml2 { + class XMLElement; +} + struct VariableValue { explicit VariableValue(MathLib::bigint val = 0) : value(val), notEqual(false) {} diff --git a/lib/checkunusedfunctions.cpp b/lib/checkunusedfunctions.cpp index 87631e759..9c4280ed5 100644 --- a/lib/checkunusedfunctions.cpp +++ b/lib/checkunusedfunctions.cpp @@ -22,6 +22,7 @@ #include "astutils.h" #include "errorlogger.h" +#include "errortypes.h" #include "library.h" #include "settings.h" #include "symboldatabase.h" @@ -29,11 +30,22 @@ #include "tokenize.h" #include "tokenlist.h" -#include #include +#include #include #include +#include +#include + #include +#include + +#include + +namespace CTU { + class FileInfo; +} + //--------------------------------------------------------------------------- diff --git a/lib/checkunusedfunctions.h b/lib/checkunusedfunctions.h index 9e2d96ce8..00423701f 100644 --- a/lib/checkunusedfunctions.h +++ b/lib/checkunusedfunctions.h @@ -35,6 +35,10 @@ class Function; class Settings; class Tokenizer; +namespace CTU { + class FileInfo; +} + /// @addtogroup Checks /** @brief Check for functions never called */ /// @{ diff --git a/lib/checkunusedvar.cpp b/lib/checkunusedvar.cpp index b88578b78..08a00e160 100644 --- a/lib/checkunusedvar.cpp +++ b/lib/checkunusedvar.cpp @@ -21,14 +21,19 @@ #include "checkunusedvar.h" #include "astutils.h" +#include "errortypes.h" +#include "library.h" #include "preprocessor.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" #include "tokenize.h" +#include "tokenlist.h" +#include "utils.h" #include #include +#include #include #include #include diff --git a/lib/checkunusedvar.h b/lib/checkunusedvar.h index 8e01b19b8..c80f798d1 100644 --- a/lib/checkunusedvar.h +++ b/lib/checkunusedvar.h @@ -24,6 +24,7 @@ #include "check.h" #include "config.h" +#include #include #include diff --git a/lib/checkvaarg.cpp b/lib/checkvaarg.cpp index 9b1388ec2..95b242c52 100644 --- a/lib/checkvaarg.cpp +++ b/lib/checkvaarg.cpp @@ -19,6 +19,7 @@ #include "checkvaarg.h" #include "astutils.h" +#include "errortypes.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" @@ -26,6 +27,7 @@ #include #include +#include //--------------------------------------------------------------------------- diff --git a/lib/clangimport.cpp b/lib/clangimport.cpp index d176fed95..06119a8f2 100644 --- a/lib/clangimport.cpp +++ b/lib/clangimport.cpp @@ -17,18 +17,30 @@ */ #include "clangimport.h" + +#include "errortypes.h" +#include "mathlib.h" #include "settings.h" #include "symboldatabase.h" +#include "token.h" #include "tokenize.h" +#include "tokenlist.h" #include "utils.h" +#include "valueflow.h" -#include #include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static const std::string AccessSpecDecl = "AccessSpecDecl"; static const std::string ArraySubscriptExpr = "ArraySubscriptExpr"; diff --git a/lib/color.cpp b/lib/color.cpp index d068ebefa..378daa143 100644 --- a/lib/color.cpp +++ b/lib/color.cpp @@ -17,9 +17,11 @@ */ #include "color.h" + #ifndef _WIN32 #include #endif +#include #include #ifdef _WIN32 diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 6554198c6..957dc8eb9 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -22,33 +22,45 @@ #include "clangimport.h" #include "color.h" #include "ctu.h" +#include "errortypes.h" +#include "exprengine.h" #include "library.h" #include "mathlib.h" #include "path.h" #include "platform.h" #include "preprocessor.h" // Preprocessor +#include "standards.h" #include "suppressions.h" #include "timer.h" +#include "token.h" #include "tokenize.h" // Tokenizer #include "tokenlist.h" +#include "utils.h" +#include "valueflow.h" #include "version.h" -#include "exprengine.h" -#include - -#define PICOJSON_USE_INT64 -#include -#include -#include #include +#include +#include #include +#include +#include +#include +#include // <- TEMPORARY +#include #include #include #include +#include +#include #include -#include -#include // <- TEMPORARY -#include + +#define PICOJSON_USE_INT64 +#include + +#include + +#include #ifdef HAVE_RULES #ifdef _WIN32 @@ -57,6 +69,8 @@ #include #endif +class SymbolDatabase; + static const char Version[] = CPPCHECK_VERSION_STRING; static const char ExtraVersion[] = ""; diff --git a/lib/cppcheck.h b/lib/cppcheck.h index 3dd755a10..4e5fe33fe 100644 --- a/lib/cppcheck.h +++ b/lib/cppcheck.h @@ -29,11 +29,13 @@ #include "importproject.h" #include "settings.h" +#include #include #include #include #include #include +#include class Tokenizer; diff --git a/lib/ctu.cpp b/lib/ctu.cpp index cb563d73c..8eed86deb 100644 --- a/lib/ctu.cpp +++ b/lib/ctu.cpp @@ -19,13 +19,22 @@ //--------------------------------------------------------------------------- #include "ctu.h" + #include "astutils.h" +#include "errortypes.h" #include "settings.h" #include "symboldatabase.h" +#include "token.h" #include "tokenize.h" +#include "tokenlist.h" + +#include +#include +#include // back_inserter +#include +#include #include -#include // back_inserter //--------------------------------------------------------------------------- static const char ATTR_CALL_ID[] = "call-id"; diff --git a/lib/ctu.h b/lib/ctu.h index f77650c68..be38c19d3 100644 --- a/lib/ctu.h +++ b/lib/ctu.h @@ -22,13 +22,27 @@ #define ctuH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" #include "errorlogger.h" +#include "mathlib.h" +#include "utils.h" #include "valueflow.h" +#include +#include #include +#include +#include class Function; +class Settings; +class Token; +class Tokenizer; + +namespace tinyxml2 { + class XMLElement; +} /// @addtogroup Core /// @{ diff --git a/lib/errorlogger.cpp b/lib/errorlogger.cpp index 8aac31399..c7aef5a52 100644 --- a/lib/errorlogger.cpp +++ b/lib/errorlogger.cpp @@ -24,16 +24,18 @@ #include "path.h" #include "token.h" #include "tokenlist.h" -#include "utils.h" -#include -#include +#include #include #include #include #include #include #include +#include +#include + +#include InternalError::InternalError(const Token *tok, const std::string &errorMsg, Type type) : token(tok), errorMessage(errorMsg), type(type) diff --git a/lib/errorlogger.h b/lib/errorlogger.h index bb74365c6..2fa16e941 100644 --- a/lib/errorlogger.h +++ b/lib/errorlogger.h @@ -26,6 +26,7 @@ #include "suppressions.h" #include "color.h" +#include #include #include #include diff --git a/lib/errortypes.h b/lib/errortypes.h index b131d6d3f..783c46b73 100644 --- a/lib/errortypes.h +++ b/lib/errortypes.h @@ -25,6 +25,7 @@ #include #include +#include /// @addtogroup Core /// @{ diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index bfb2a150f..167017dcd 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -134,15 +134,28 @@ #include "astutils.h" #include "bughuntingchecks.h" #include "errorlogger.h" +#include "library.h" +#include "mathlib.h" +#include "platform.h" #include "settings.h" #include "symboldatabase.h" +#include "token.h" #include "tokenize.h" +#include "tokenlist.h" +#include "utils.h" #include -#include -#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include + #ifdef USE_Z3 #include #include diff --git a/lib/exprengine.h b/lib/exprengine.h index 5bdc0429c..1b32b3d68 100644 --- a/lib/exprengine.h +++ b/lib/exprengine.h @@ -24,11 +24,14 @@ #include "config.h" #include "errortypes.h" +#include #include +#include #include #include #include #include +#include class ErrorLogger; class Tokenizer; diff --git a/lib/forwardanalyzer.cpp b/lib/forwardanalyzer.cpp index 92d3b19fe..46c3768df 100644 --- a/lib/forwardanalyzer.cpp +++ b/lib/forwardanalyzer.cpp @@ -17,8 +17,12 @@ */ #include "forwardanalyzer.h" + #include "analyzer.h" #include "astutils.h" +#include "config.h" +#include "errortypes.h" +#include "mathlib.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" @@ -27,8 +31,13 @@ #include #include #include +#include +#include +#include #include +#include #include +#include struct OnExit { std::function f; diff --git a/lib/importproject.cpp b/lib/importproject.cpp index aafbe9268..c5ea4e600 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -20,18 +20,25 @@ #include "path.h" #include "settings.h" +#include "standards.h" #include "suppressions.h" -#include "tinyxml2.h" #include "token.h" #include "tokenize.h" #include "utils.h" -#define PICOJSON_USE_INT64 -#include +#include +#include #include #include +#include +#include + #include +#include + +#define PICOJSON_USE_INT64 +#include ImportProject::ImportProject() { diff --git a/lib/importproject.h b/lib/importproject.h index faf63fa40..a3236fe2f 100644 --- a/lib/importproject.h +++ b/lib/importproject.h @@ -25,6 +25,7 @@ #include "platform.h" #include "utils.h" +#include #include #include #include diff --git a/lib/infer.cpp b/lib/infer.cpp index d1f795287..2127bb0ea 100644 --- a/lib/infer.cpp +++ b/lib/infer.cpp @@ -17,10 +17,19 @@ */ #include "infer.h" + #include "calculate.h" +#include "errortypes.h" #include "valueptr.h" + +#include +#include +#include #include #include +#include + +class Token; template static const ValueFlow::Value* getCompareValue(const std::list& values, Predicate pred, Compare compare) diff --git a/lib/infer.h b/lib/infer.h index 02ed2255e..a289c1e7b 100644 --- a/lib/infer.h +++ b/lib/infer.h @@ -19,12 +19,16 @@ #ifndef inferH #define inferH +#include "config.h" #include "mathlib.h" #include "valueflow.h" +#include +#include +#include + struct Interval; -template -class ValuePtr; +template class ValuePtr; struct InferModel { virtual bool match(const ValueFlow::Value& value) const = 0; diff --git a/lib/library.cpp b/lib/library.cpp index 371ca70d4..33d5c38d8 100644 --- a/lib/library.cpp +++ b/lib/library.cpp @@ -22,17 +22,22 @@ #include "mathlib.h" #include "path.h" #include "symboldatabase.h" -#include "tinyxml2.h" #include "token.h" #include "tokenlist.h" #include "utils.h" +#include "valueflow.h" #include +#include #include #include +#include #include +#include #include +#include + static std::vector getnames(const char *names) { std::vector ret; diff --git a/lib/mathlib.cpp b/lib/mathlib.cpp index ee9747842..4bd2f4a76 100644 --- a/lib/mathlib.cpp +++ b/lib/mathlib.cpp @@ -21,15 +21,16 @@ #include "errortypes.h" #include "utils.h" -#include - #include #include #include +#include #include #include #include +#include + #if defined(_MSC_VER) && _MSC_VER <= 1700 // VS2012 doesn't have std::isinf and std::isnan #define ISINF(x) (!_finite(x)) #define ISNAN(x) (_isnan(x)) diff --git a/lib/pathanalysis.cpp b/lib/pathanalysis.cpp index 4381e8e78..1b9e7a300 100644 --- a/lib/pathanalysis.cpp +++ b/lib/pathanalysis.cpp @@ -17,11 +17,16 @@ */ #include "pathanalysis.h" + #include "astutils.h" #include "symboldatabase.h" #include "token.h" #include "valueflow.h" + #include +#include +#include +#include const Scope* PathAnalysis::findOuterScope(const Scope * scope) { diff --git a/lib/pathanalysis.h b/lib/pathanalysis.h index b8b01801a..1cad49836 100644 --- a/lib/pathanalysis.h +++ b/lib/pathanalysis.h @@ -22,6 +22,8 @@ #include "errortypes.h" #include +#include +#include class Library; class Scope; diff --git a/lib/platform.cpp b/lib/platform.cpp index 8ebc83b11..8796635b1 100644 --- a/lib/platform.cpp +++ b/lib/platform.cpp @@ -17,13 +17,17 @@ */ #include "platform.h" + #include "path.h" -#include "tinyxml2.h" + +#include #include #include #include #include +#include + cppcheck::Platform::Platform() { // This assumes the code you are checking is for the same architecture this is compiled on. diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index a8223bf91..1f5f67d8f 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -20,17 +20,22 @@ #include "preprocessor.h" #include "errorlogger.h" +#include "errortypes.h" #include "library.h" #include "path.h" #include "settings.h" -#include "simplecpp.h" +#include "standards.h" #include "suppressions.h" #include +#include #include #include // back_inserter +#include #include +#include + static bool sameline(const simplecpp::Token *tok1, const simplecpp::Token *tok2) { return tok1 && tok2 && tok1->location.sameline(tok2->location); diff --git a/lib/programmemory.cpp b/lib/programmemory.cpp index 8821fbc8e..96326f57d 100644 --- a/lib/programmemory.cpp +++ b/lib/programmemory.cpp @@ -17,19 +17,27 @@ */ #include "programmemory.h" + #include "astutils.h" #include "calculate.h" #include "infer.h" +#include "library.h" #include "mathlib.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" #include "valueflow.h" #include "valueptr.h" + #include #include #include +#include #include +#include +#include +#include +#include void ProgramMemory::setValue(nonneg int exprid, const ValueFlow::Value& value) { diff --git a/lib/reverseanalyzer.cpp b/lib/reverseanalyzer.cpp index 90db4e69d..a509400d2 100644 --- a/lib/reverseanalyzer.cpp +++ b/lib/reverseanalyzer.cpp @@ -17,16 +17,23 @@ */ #include "reverseanalyzer.h" + #include "analyzer.h" #include "astutils.h" #include "errortypes.h" #include "forwardanalyzer.h" +#include "mathlib.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" #include "valueptr.h" #include +#include +#include +#include +#include +#include struct ReverseTraversal { ReverseTraversal(const ValuePtr& analyzer, const Settings* settings) diff --git a/lib/settings.h b/lib/settings.h index 514feddc7..4fe5e0bda 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -22,6 +22,7 @@ //--------------------------------------------------------------------------- #include "config.h" +#include "errortypes.h" #include "importproject.h" #include "library.h" #include "platform.h" @@ -31,7 +32,9 @@ #include #include +#include #include +#include #include #include #include diff --git a/lib/summaries.cpp b/lib/summaries.cpp index 98e5de43c..4009a924e 100644 --- a/lib/summaries.cpp +++ b/lib/summaries.cpp @@ -21,7 +21,9 @@ #include "analyzerinfo.h" #include "settings.h" #include "symboldatabase.h" +#include "token.h" #include "tokenize.h" +#include "tokenlist.h" #include #include diff --git a/lib/suppressions.cpp b/lib/suppressions.cpp index afa0e06bd..0571e7d47 100644 --- a/lib/suppressions.cpp +++ b/lib/suppressions.cpp @@ -23,12 +23,14 @@ #include "path.h" #include "utils.h" -#include - #include #include // std::isdigit, std::isalnum, etc +#include +#include #include // std::bind, std::placeholders +#include + static bool isAcceptedErrorIdChar(char c) { switch (c) { diff --git a/lib/suppressions.h b/lib/suppressions.h index 4dc08945f..73c85ff5d 100644 --- a/lib/suppressions.h +++ b/lib/suppressions.h @@ -23,6 +23,7 @@ #include "config.h" #include "errortypes.h" +#include #include #include #include diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 6f76515d4..a5c0cd773 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -21,10 +21,13 @@ #include "astutils.h" #include "errorlogger.h" +#include "errortypes.h" #include "library.h" #include "mathlib.h" #include "platform.h" #include "settings.h" +#include "standards.h" +#include "templatesimplifier.h" #include "token.h" #include "tokenize.h" #include "tokenlist.h" @@ -37,8 +40,10 @@ #include #include #include +#include #include #include +#include //--------------------------------------------------------------------------- SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index 923a5badf..351ac92c9 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -28,10 +28,13 @@ #include "utils.h" #include +#include #include #include +#include #include #include +#include #include #include diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index 02a6bc79f..0762ca5bb 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -19,8 +19,10 @@ #include "templatesimplifier.h" #include "errorlogger.h" +#include "errortypes.h" #include "mathlib.h" #include "settings.h" +#include "standards.h" #include "token.h" #include "tokenize.h" #include "tokenlist.h" @@ -29,7 +31,9 @@ #include #include #include +#include #include +#include #include static Token *skipRequires(Token *tok) diff --git a/lib/token.cpp b/lib/token.cpp index dd270d327..8bbb2f537 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -19,6 +19,7 @@ #include "token.h" #include "astutils.h" +#include "errortypes.h" #include "library.h" #include "settings.h" #include "symboldatabase.h" @@ -30,12 +31,17 @@ #include #include #include +#include +#include +#include #include #include #include +#include #include #include #include +#include #include const std::list TokenImpl::mEmptyValueList; diff --git a/lib/token.h b/lib/token.h index ba23cba17..794e39810 100644 --- a/lib/token.h +++ b/lib/token.h @@ -27,12 +27,15 @@ #include "templatesimplifier.h" #include "utils.h" +#include #include #include #include #include #include +#include #include +#include #include class Enumerator; @@ -43,8 +46,8 @@ class Type; class ValueType; class Variable; class TokenList; - class ConstTokenRange; +class Token; /** * @brief This struct stores pointers to the front and back tokens of the list this token is in. diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index b7bc852aa..9cc318ff9 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -38,13 +38,23 @@ #include #include #include +#include #include #include +#include +#include +#include #include #include +#include +#include #include +#include #include #include + +#include + //--------------------------------------------------------------------------- namespace { diff --git a/lib/tokenize.h b/lib/tokenize.h index 13de2cc70..995f2d057 100644 --- a/lib/tokenize.h +++ b/lib/tokenize.h @@ -24,11 +24,15 @@ #include "config.h" #include "errortypes.h" #include "tokenlist.h" +#include "utils.h" +#include #include #include #include #include +#include +#include class Settings; class SymbolDatabase; diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index fa5dccbfa..326055330 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -21,19 +21,24 @@ #include "astutils.h" #include "errorlogger.h" +#include "errortypes.h" #include "library.h" #include "path.h" #include "settings.h" #include "standards.h" #include "token.h" -#include -#include +#include #include #include +#include +#include +#include #include #include +#include + // How many compileExpression recursions are allowed? // For practical code this could be endless. But in some special torture test // there needs to be a limit. diff --git a/lib/tokenlist.h b/lib/tokenlist.h index 6a5cbd57d..6118ea1e5 100644 --- a/lib/tokenlist.h +++ b/lib/tokenlist.h @@ -23,7 +23,9 @@ #include "config.h" #include "token.h" +#include "utils.h" +#include #include #include #include diff --git a/lib/utils.cpp b/lib/utils.cpp index 7f5c8c5ed..231da9e1e 100644 --- a/lib/utils.cpp +++ b/lib/utils.cpp @@ -18,9 +18,11 @@ #include "utils.h" -#include -#include #include +#include +#include +#include +#include int caseInsensitiveStringCompare(const std::string &lhs, const std::string &rhs) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index b0a87da43..c06a07741 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -103,12 +103,17 @@ #include #include #include +#include #include #include +#include #include +#include +#include #include #include #include +#include #include #include #include diff --git a/lib/valueflow.h b/lib/valueflow.h index 25187d162..8680b1854 100644 --- a/lib/valueflow.h +++ b/lib/valueflow.h @@ -25,7 +25,9 @@ #include "mathlib.h" #include "utils.h" +#include #include +#include #include #include #include diff --git a/test/test64bit.cpp b/test/test64bit.cpp index 4e3ff768a..df4501fff 100644 --- a/test/test64bit.cpp +++ b/test/test64bit.cpp @@ -18,10 +18,13 @@ #include "check64bit.h" +#include "config.h" +#include "errortypes.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include class Test64BitPortability : public TestFixture { public: diff --git a/test/testassert.cpp b/test/testassert.cpp index 543b27512..8a5a69939 100644 --- a/test/testassert.cpp +++ b/test/testassert.cpp @@ -18,10 +18,14 @@ #include "checkassert.h" +#include "config.h" +#include "errortypes.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include + class TestAssert : public TestFixture { public: diff --git a/test/testastutils.cpp b/test/testastutils.cpp index d3cf86eb2..0392b0313 100644 --- a/test/testastutils.cpp +++ b/test/testastutils.cpp @@ -18,6 +18,8 @@ #include "astutils.h" +#include "config.h" +#include "library.h" #include "settings.h" #include "testsuite.h" #include "token.h" @@ -25,6 +27,7 @@ #include "tokenlist.h" #include +#include class TestAstUtils : public TestFixture { public: diff --git a/test/testautovariables.cpp b/test/testautovariables.cpp index cb8ad157a..1aa40e671 100644 --- a/test/testautovariables.cpp +++ b/test/testautovariables.cpp @@ -18,10 +18,13 @@ #include "checkautovariables.h" +#include "config.h" +#include "errortypes.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include class TestAutoVariables : public TestFixture { public: diff --git a/test/testbool.cpp b/test/testbool.cpp index e553743ea..06d2a736a 100644 --- a/test/testbool.cpp +++ b/test/testbool.cpp @@ -18,10 +18,13 @@ #include "checkbool.h" +#include "config.h" +#include "errortypes.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include class TestBool : public TestFixture { public: diff --git a/test/testboost.cpp b/test/testboost.cpp index 700aa3859..d3766a9a1 100644 --- a/test/testboost.cpp +++ b/test/testboost.cpp @@ -18,10 +18,13 @@ #include "checkboost.h" +#include "config.h" +#include "errortypes.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include class TestBoost : public TestFixture { public: diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index e121faf15..1e588e7ba 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -21,15 +21,23 @@ #include "checkbufferoverrun.h" #include "config.h" #include "ctu.h" +#include "errortypes.h" +#include "standards.h" #include "library.h" #include "preprocessor.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include +#include #include -#include #include +#include +#include + +#include + #include class TestBufferOverrun : public TestFixture { diff --git a/test/testbughuntingchecks.cpp b/test/testbughuntingchecks.cpp index 22c72384d..43ed5187b 100644 --- a/test/testbughuntingchecks.cpp +++ b/test/testbughuntingchecks.cpp @@ -17,11 +17,16 @@ */ #include "config.h" +#include "errortypes.h" #include "exprengine.h" +#include "library.h" +#include "platform.h" #include "settings.h" #include "tokenize.h" #include "testsuite.h" +#include + class TestBughuntingChecks : public TestFixture { public: TestBughuntingChecks() : TestFixture("TestBughuntingChecks") { diff --git a/test/testcharvar.cpp b/test/testcharvar.cpp index 344eccc8b..f04cfc860 100644 --- a/test/testcharvar.cpp +++ b/test/testcharvar.cpp @@ -18,11 +18,14 @@ #include "checkother.h" +#include "config.h" +#include "errortypes.h" #include "platform.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include class TestCharVar : public TestFixture { public: diff --git a/test/testclangimport.cpp b/test/testclangimport.cpp index a28a8c14f..f74e5977d 100644 --- a/test/testclangimport.cpp +++ b/test/testclangimport.cpp @@ -15,11 +15,21 @@ // along with this program. If not, see . #include "clangimport.h" +#include "config.h" +#include "platform.h" #include "settings.h" #include "symboldatabase.h" +#include "token.h" #include "tokenize.h" #include "testsuite.h" +#include +#include +#include +#include +#include +#include + class TestClangImport : public TestFixture { public: diff --git a/test/testclass.cpp b/test/testclass.cpp index 75ed6238e..66b0ed4b5 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -16,14 +16,22 @@ * along with this program. If not, see . */ -#include - +#include "check.h" #include "checkclass.h" +#include "config.h" +#include "errortypes.h" #include "library.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include +#include +#include +#include + +#include + class TestClass : public TestFixture { public: diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index eb56b123d..5be969650 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -17,6 +17,8 @@ */ #include "cmdlineparser.h" +#include "config.h" +#include "errortypes.h" #include "platform.h" #include "redirect.h" #include "settings.h" diff --git a/test/testcondition.cpp b/test/testcondition.cpp index 5d5602a5f..e7b0a05dc 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -17,17 +17,25 @@ */ #include "checkcondition.h" +#include "config.h" +#include "errortypes.h" #include "library.h" +#include "platform.h" #include "preprocessor.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" -#include -#include +#include #include +#include +#include #include +#include + +#include + class TestCondition : public TestFixture { public: TestCondition() : TestFixture("TestCondition") {} diff --git a/test/testconstructors.cpp b/test/testconstructors.cpp index faaf63169..cf3291c99 100644 --- a/test/testconstructors.cpp +++ b/test/testconstructors.cpp @@ -18,10 +18,17 @@ #include "checkclass.h" +#include "config.h" +#include "errortypes.h" +#include "standards.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include +#include +#include + class TestConstructors : public TestFixture { public: diff --git a/test/testcppcheck.cpp b/test/testcppcheck.cpp index b7c9d68bb..a2d0462b9 100644 --- a/test/testcppcheck.cpp +++ b/test/testcppcheck.cpp @@ -18,11 +18,13 @@ #include "check.h" #include "color.h" +#include "config.h" #include "cppcheck.h" #include "errorlogger.h" #include "testsuite.h" #include +#include #include #include diff --git a/test/testerrorlogger.cpp b/test/testerrorlogger.cpp index 847f99ee9..3e9f524be 100644 --- a/test/testerrorlogger.cpp +++ b/test/testerrorlogger.cpp @@ -19,13 +19,16 @@ #include "config.h" #include "cppcheck.h" #include "errorlogger.h" +#include "errortypes.h" #include "suppressions.h" #include "testsuite.h" -#include +#include #include +#include #include +#include class TestErrorLogger : public TestFixture { public: diff --git a/test/testexceptionsafety.cpp b/test/testexceptionsafety.cpp index 0c7670158..f1e4b02fe 100644 --- a/test/testexceptionsafety.cpp +++ b/test/testexceptionsafety.cpp @@ -18,10 +18,13 @@ #include "checkexceptionsafety.h" +#include "config.h" +#include "errortypes.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include class TestExceptionSafety : public TestFixture { public: diff --git a/test/testexprengine.cpp b/test/testexprengine.cpp index 5142e87be..6438c224e 100644 --- a/test/testexprengine.cpp +++ b/test/testexprengine.cpp @@ -25,7 +25,12 @@ #include "tokenize.h" #include "testsuite.h" +#include +#include +#include +#include #include +#include class TestExprEngine : public TestFixture { public: diff --git a/test/testfilelister.cpp b/test/testfilelister.cpp index e1348c9fb..227509c8f 100644 --- a/test/testfilelister.cpp +++ b/test/testfilelister.cpp @@ -16,14 +16,17 @@ * along with this program. If not, see . */ +#include "config.h" #include "filelister.h" #include "pathmatch.h" #include "testsuite.h" +#include #include #include #include #include +#include class TestFileLister : public TestFixture { public: diff --git a/test/testfunctions.cpp b/test/testfunctions.cpp index 05e16b6f8..29947e3f0 100644 --- a/test/testfunctions.cpp +++ b/test/testfunctions.cpp @@ -16,15 +16,20 @@ * along with this program. If not, see . */ -#include - #include "checkfunctions.h" +#include "config.h" +#include "errortypes.h" #include "library.h" #include "settings.h" #include "standards.h" #include "testsuite.h" #include "tokenize.h" +#include +#include +#include + +#include class TestFunctions : public TestFixture { public: diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index f9197ba9f..898d34b78 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -17,12 +17,17 @@ */ #include "check.h" +#include "config.h" +#include "errortypes.h" +#include "mathlib.h" #include "settings.h" #include "testsuite.h" #include "token.h" #include "tokenize.h" +#include #include +#include class TestGarbage : public TestFixture { diff --git a/test/testimportproject.cpp b/test/testimportproject.cpp index 570f36ee5..840acd779 100644 --- a/test/testimportproject.cpp +++ b/test/testimportproject.cpp @@ -16,13 +16,17 @@ * along with this program. If not, see . */ +#include "config.h" #include "importproject.h" #include "settings.h" #include "testsuite.h" +#include #include +#include #include #include +#include class TestImporter : public ImportProject { public: diff --git a/test/testincompletestatement.cpp b/test/testincompletestatement.cpp index a99900b57..8a37bf932 100644 --- a/test/testincompletestatement.cpp +++ b/test/testincompletestatement.cpp @@ -17,14 +17,20 @@ */ #include "checkother.h" +#include "config.h" +#include "errortypes.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" -#include +#include #include +#include +#include #include +#include + class TestIncompleteStatement : public TestFixture { public: TestIncompleteStatement() : TestFixture("TestIncompleteStatement") {} diff --git a/test/testio.cpp b/test/testio.cpp index 775568d78..abd4928f9 100644 --- a/test/testio.cpp +++ b/test/testio.cpp @@ -18,11 +18,15 @@ #include "checkio.h" +#include "config.h" +#include "errortypes.h" #include "platform.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include + class TestIO : public TestFixture { public: diff --git a/test/testleakautovar.cpp b/test/testleakautovar.cpp index 475743c34..3e4952a60 100644 --- a/test/testleakautovar.cpp +++ b/test/testleakautovar.cpp @@ -18,15 +18,26 @@ #include "checkleakautovar.h" +#include "config.h" +#include "errortypes.h" #include "library.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" -#include -#include +#include +#include +#include +#include #include +#include + +#include + +class TestLeakAutoVarStrcpy; +class TestLeakAutoVarWindows; + class TestLeakAutoVar : public TestFixture { public: TestLeakAutoVar() : TestFixture("TestLeakAutoVar") {} diff --git a/test/testlibrary.cpp b/test/testlibrary.cpp index 7006b7647..0da4bed29 100644 --- a/test/testlibrary.cpp +++ b/test/testlibrary.cpp @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +#include "config.h" +#include "errortypes.h" #include "library.h" #include "settings.h" #include "standards.h" @@ -24,11 +26,14 @@ #include "tokenize.h" #include "tokenlist.h" -#include +#include #include #include +#include #include +#include + #define ASSERT_EQ(expected, actual) ASSERT(expected == actual) class TestLibrary : public TestFixture { diff --git a/test/testmathlib.cpp b/test/testmathlib.cpp index c1b2d7640..7c560db22 100644 --- a/test/testmathlib.cpp +++ b/test/testmathlib.cpp @@ -17,10 +17,12 @@ */ +#include "config.h" #include "mathlib.h" #include "testsuite.h" #include +#include struct InternalError; diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index e4ea82944..577b1939d 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -15,17 +15,25 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "checkmemoryleak.h" #include "config.h" +#include "errortypes.h" #include "settings.h" #include "symboldatabase.h" #include "testsuite.h" #include "token.h" #include "tokenize.h" +#include #include +#include #include +class TestMemleakInClass; +class TestMemleakNoVar; +class TestMemleakStructMember; + class TestMemleak : private TestFixture { public: diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index cfd2028a6..7d0986e2c 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -20,18 +20,23 @@ #include "checknullpointer.h" #include "config.h" #include "ctu.h" +#include "errortypes.h" #include "library.h" #include "settings.h" #include "testsuite.h" #include "token.h" #include "tokenize.h" -#include +#include #include #include #include +#include +#include #include +#include + class TestNullPointer : public TestFixture { public: TestNullPointer() : TestFixture("TestNullPointer") {} diff --git a/test/testoptions.cpp b/test/testoptions.cpp index 0ca538a70..a86d28d47 100644 --- a/test/testoptions.cpp +++ b/test/testoptions.cpp @@ -14,9 +14,13 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +#include "config.h" #include "options.h" #include "testsuite.h" +#include +#include + class TestOptions : public TestFixture { public: diff --git a/test/testother.cpp b/test/testother.cpp index df457a479..698275c3c 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -17,6 +17,8 @@ */ #include "checkother.h" +#include "config.h" +#include "errortypes.h" #include "library.h" #include "platform.h" #include "preprocessor.h" @@ -25,12 +27,18 @@ #include "testsuite.h" #include "tokenize.h" -#include -#include +#include +#include #include #include +#include +#include #include +#include +#include + + class TestOther : public TestFixture { public: TestOther() : TestFixture("TestOther") {} diff --git a/test/testpath.cpp b/test/testpath.cpp index 6e5adcd0c..acc0906fa 100644 --- a/test/testpath.cpp +++ b/test/testpath.cpp @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +#include "config.h" #include "path.h" #include "testsuite.h" diff --git a/test/testpathmatch.cpp b/test/testpathmatch.cpp index ea1395649..6f17112a7 100644 --- a/test/testpathmatch.cpp +++ b/test/testpathmatch.cpp @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +#include "config.h" #include "pathmatch.h" #include "testsuite.h" diff --git a/test/testpostfixoperator.cpp b/test/testpostfixoperator.cpp index e503e7699..28f5ec0c2 100644 --- a/test/testpostfixoperator.cpp +++ b/test/testpostfixoperator.cpp @@ -18,10 +18,13 @@ #include "checkpostfixoperator.h" +#include "config.h" +#include "errortypes.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include class TestPostfixOperator : public TestFixture { public: diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 3f1c058f6..0964fe65e 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -20,19 +20,25 @@ // The preprocessor that Cppcheck uses is a bit special. Instead of generating // the code for a known configuration, it generates the code for each configuration. +#include "config.h" +#include "errortypes.h" #include "platform.h" #include "preprocessor.h" #include "settings.h" #include "testsuite.h" -#include +#include #include +#include #include #include +#include #include #include #include +#include + class ErrorLogger; class TestPreprocessor : public TestFixture { diff --git a/test/testrunner.cpp b/test/testrunner.cpp index 68921b742..7e85bd3ff 100644 --- a/test/testrunner.cpp +++ b/test/testrunner.cpp @@ -16,11 +16,15 @@ * along with this program. If not, see . */ +#include "errortypes.h" #include "options.h" #include "preprocessor.h" #include "testsuite.h" #include +#include +#include + #ifdef NDEBUG #include #endif diff --git a/test/testsimplifytemplate.cpp b/test/testsimplifytemplate.cpp index 745aafb3a..48508f45e 100644 --- a/test/testsimplifytemplate.cpp +++ b/test/testsimplifytemplate.cpp @@ -18,14 +18,19 @@ #include "config.h" +#include "errortypes.h" #include "platform.h" #include "settings.h" #include "templatesimplifier.h" #include "testsuite.h" #include "token.h" #include "tokenize.h" +#include "tokenlist.h" #include +#include +#include +#include class TestSimplifyTemplate : public TestFixture { diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index 0a5ca78d8..991ee5886 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -16,13 +16,16 @@ * along with this program. If not, see . */ +#include "config.h" +#include "errortypes.h" #include "platform.h" #include "settings.h" +#include "standards.h" #include "testsuite.h" #include "token.h" #include "tokenize.h" -#include "tokenlist.h" +#include #include diff --git a/test/testsimplifytypedef.cpp b/test/testsimplifytypedef.cpp index 9cfd1b9af..61b665156 100644 --- a/test/testsimplifytypedef.cpp +++ b/test/testsimplifytypedef.cpp @@ -17,6 +17,8 @@ */ +#include "config.h" +#include "errortypes.h" #include "platform.h" #include "settings.h" #include "testsuite.h" @@ -24,7 +26,12 @@ #include "tokenize.h" #include "tokenlist.h" +#include #include +#include +#include +#include + #include diff --git a/test/testsimplifyusing.cpp b/test/testsimplifyusing.cpp index ee739ea79..fa6770825 100644 --- a/test/testsimplifyusing.cpp +++ b/test/testsimplifyusing.cpp @@ -18,12 +18,16 @@ #include "config.h" +#include "errortypes.h" #include "platform.h" #include "settings.h" #include "testsuite.h" #include "token.h" #include "tokenize.h" +#include +#include + class TestSimplifyUsing : public TestFixture { public: diff --git a/test/testsizeof.cpp b/test/testsizeof.cpp index f7732b00f..ba8f2e1b3 100644 --- a/test/testsizeof.cpp +++ b/test/testsizeof.cpp @@ -17,14 +17,20 @@ */ #include "checksizeof.h" +#include "config.h" +#include "errortypes.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" -#include +#include #include +#include +#include #include +#include + class TestSizeof : public TestFixture { public: TestSizeof() : TestFixture("TestSizeof") {} diff --git a/test/teststl.cpp b/test/teststl.cpp index 568fbacbf..b43544012 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -17,12 +17,15 @@ */ #include "checkstl.h" +#include "config.h" +#include "errortypes.h" #include "settings.h" #include "standards.h" #include "testsuite.h" #include "tokenize.h" #include +#include #include diff --git a/test/teststring.cpp b/test/teststring.cpp index fecfe5e77..806fdc83f 100644 --- a/test/teststring.cpp +++ b/test/teststring.cpp @@ -18,10 +18,14 @@ #include "checkstring.h" +#include "config.h" +#include "errortypes.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include + class TestString : public TestFixture { public: diff --git a/test/testsuite.h b/test/testsuite.h index 291aa7abf..f5b1b21d3 100644 --- a/test/testsuite.h +++ b/test/testsuite.h @@ -27,6 +27,7 @@ #include #include #include +#include class options; diff --git a/test/testsummaries.cpp b/test/testsummaries.cpp index 673a04599..26c1b18d0 100644 --- a/test/testsummaries.cpp +++ b/test/testsummaries.cpp @@ -17,12 +17,15 @@ */ +#include "config.h" +#include "settings.h" #include "summaries.h" #include "testsuite.h" - -#include "settings.h" #include "tokenize.h" +#include // for istringstream, ostringstream +#include + class TestSummaries : public TestFixture { public: diff --git a/test/testsuppressions.cpp b/test/testsuppressions.cpp index c275c584a..7d528e469 100644 --- a/test/testsuppressions.cpp +++ b/test/testsuppressions.cpp @@ -18,13 +18,19 @@ #include "config.h" #include "cppcheck.h" +#include "errortypes.h" #include "settings.h" #include "suppressions.h" #include "testsuite.h" #include "threadexecutor.h" +#include +#include +#include +#include #include #include +#include #include #include #include diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index 3c03e9d8f..55029814a 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -32,14 +32,18 @@ #include #include #include +#include #include #include #include #include -#include +#include #include +#include + struct InternalError; +class TestSymbolDatabase; #define GET_SYMBOL_DB_STD(code) \ Tokenizer tokenizer(&settings1, this); \ diff --git a/test/testthreadexecutor.cpp b/test/testthreadexecutor.cpp index 164cb605b..0cb691f69 100644 --- a/test/testthreadexecutor.cpp +++ b/test/testthreadexecutor.cpp @@ -16,11 +16,14 @@ * along with this program. If not, see . */ +#include "config.h" #include "settings.h" #include "testsuite.h" #include "threadexecutor.h" +#include #include +#include #include #include diff --git a/test/testtimer.cpp b/test/testtimer.cpp index e750e2068..ce991edc4 100644 --- a/test/testtimer.cpp +++ b/test/testtimer.cpp @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +#include "config.h" #include "testsuite.h" #include "timer.h" diff --git a/test/testtoken.cpp b/test/testtoken.cpp index b3c851d3d..2f60c19dc 100644 --- a/test/testtoken.cpp +++ b/test/testtoken.cpp @@ -16,13 +16,17 @@ * along with this program. If not, see . */ +#include "config.h" #include "settings.h" #include "testsuite.h" #include "testutils.h" #include "token.h" #include "tokenize.h" #include "tokenlist.h" +#include "valueflow.h" +#include +#include #include #include diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index ec7e4741c..fdafe4fa5 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -27,9 +27,14 @@ #include "tokenlist.h" #include +#include #include #include #include +#include +#include + +#include struct InternalError; diff --git a/test/testtokenlist.cpp b/test/testtokenlist.cpp index 3cd662d6a..c3e12bd3b 100644 --- a/test/testtokenlist.cpp +++ b/test/testtokenlist.cpp @@ -16,11 +16,13 @@ * along with this program. If not, see . */ +#include "config.h" #include "settings.h" #include "testsuite.h" #include "token.h" #include "tokenlist.h" +#include #include class TestTokenList : public TestFixture { diff --git a/test/testtokenrange.cpp b/test/testtokenrange.cpp index 30e899670..53322b85d 100644 --- a/test/testtokenrange.cpp +++ b/test/testtokenrange.cpp @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +#include "config.h" #include "settings.h" #include "testsuite.h" #include "token.h" @@ -24,6 +25,10 @@ #include "tokenrange.h" #include "symboldatabase.h" +#include +#include +#include +#include #include diff --git a/test/testtype.cpp b/test/testtype.cpp index f77f5f311..96257e852 100644 --- a/test/testtype.cpp +++ b/test/testtype.cpp @@ -17,11 +17,15 @@ */ #include "checktype.h" +#include "config.h" +#include "errortypes.h" #include "platform.h" #include "settings.h" +#include "standards.h" #include "testsuite.h" #include "tokenize.h" +#include #include class TestType : public TestFixture { diff --git a/test/testuninitvar.cpp b/test/testuninitvar.cpp index 8e0d12066..15fe8b54a 100644 --- a/test/testuninitvar.cpp +++ b/test/testuninitvar.cpp @@ -16,12 +16,17 @@ * along with this program. If not, see . */ +#include "check.h" #include "checkuninitvar.h" +#include "config.h" +#include "ctu.h" +#include "errortypes.h" #include "library.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include #include #include diff --git a/test/testunusedfunctions.cpp b/test/testunusedfunctions.cpp index b2aafbcae..f713601a5 100644 --- a/test/testunusedfunctions.cpp +++ b/test/testunusedfunctions.cpp @@ -17,11 +17,14 @@ */ #include "checkunusedfunctions.h" +#include "config.h" +#include "errortypes.h" #include "platform.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include #include class TestUnusedFunctions : public TestFixture { diff --git a/test/testunusedprivfunc.cpp b/test/testunusedprivfunc.cpp index 24f849e29..817db72ce 100644 --- a/test/testunusedprivfunc.cpp +++ b/test/testunusedprivfunc.cpp @@ -17,15 +17,21 @@ */ #include "checkclass.h" +#include "config.h" +#include "errortypes.h" #include "platform.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" -#include +#include #include +#include +#include #include +#include + class TestUnusedPrivateFunction : public TestFixture { public: TestUnusedPrivateFunction() : TestFixture("TestUnusedPrivateFunction") {} diff --git a/test/testunusedvar.cpp b/test/testunusedvar.cpp index 66fa9c77f..1242d250f 100644 --- a/test/testunusedvar.cpp +++ b/test/testunusedvar.cpp @@ -17,11 +17,15 @@ */ #include "checkunusedvar.h" +#include "config.h" +#include "errortypes.h" #include "preprocessor.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include +#include #include class TestUnusedVar : public TestFixture { diff --git a/test/testutils.h b/test/testutils.h index 902ae6c11..95064c928 100644 --- a/test/testutils.h +++ b/test/testutils.h @@ -20,9 +20,16 @@ #define TestUtilsH #include "color.h" +#include "config.h" #include "errorlogger.h" #include "settings.h" +#include "suppressions.h" #include "tokenize.h" +#include "tokenlist.h" + +#include +#include +#include class Token; diff --git a/test/testvaarg.cpp b/test/testvaarg.cpp index 46d9a790f..8410aab29 100644 --- a/test/testvaarg.cpp +++ b/test/testvaarg.cpp @@ -18,10 +18,13 @@ #include "checkvaarg.h" +#include "config.h" +#include "errortypes.h" #include "settings.h" #include "testsuite.h" #include "tokenize.h" +#include class TestVaarg : public TestFixture { public: diff --git a/test/testvalueflow.cpp b/test/testvalueflow.cpp index 4819ca883..44ae594cf 100644 --- a/test/testvalueflow.cpp +++ b/test/testvalueflow.cpp @@ -16,7 +16,9 @@ * along with this program. If not, see . */ +#include "config.h" #include "library.h" +#include "mathlib.h" #include "platform.h" #include "settings.h" #include "testsuite.h" @@ -25,17 +27,22 @@ #include "valueflow.h" #include +#include #include #include #include #include #include #include -#include +#include +#include +#include #include #include #include +#include + class TestValueFlow : public TestFixture { public: TestValueFlow() : TestFixture("TestValueFlow") {} diff --git a/test/testvarid.cpp b/test/testvarid.cpp index aae6278df..950e69e22 100644 --- a/test/testvarid.cpp +++ b/test/testvarid.cpp @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +#include "config.h" +#include "mathlib.h" #include "platform.h" #include "settings.h" #include "standards.h" @@ -23,6 +25,7 @@ #include "token.h" #include "tokenize.h" +#include #include struct InternalError;