From 4b80e91145d84a3869a82054ea281d2ab1a4ad58 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Sun, 10 Jun 2012 05:19:09 -0700 Subject: [PATCH] Implemented support for building cppcheck lib into a dll Updated VS9 solution New VS10 solution that builds cppcheck into a dll used by cli and testrunner. Functional changes and advantages of new solution: - Share code between testrunner and cli; ability to share code with gui as well (not yet implemented) - Files of /lib are no longer compiled twice (should improve build time on single core machines) - Added configuration for building with PCRE support - Executables are build into /bin (/bin/debug in debug mode) folder (Should no longer require rebuild when switching between debug and release) - Completely x64 compatible (contains also x64-debug configuration now) --- cli/cli.vcxproj | 247 ++++++++++++++++++ cli/cli.vcxproj.filters | 86 +++++++ cli/cppcheck.vcxproj | 229 ----------------- cli/cppcheck.vcxproj.filters | 302 ---------------------- cppcheck_vs2010.sln | 76 +++++- lib/check.h | 3 +- lib/check64bit.h | 3 +- lib/checkassignif.h | 3 +- lib/checkautovariables.h | 3 +- lib/checkboost.h | 3 +- lib/checkbufferoverrun.h | 5 +- lib/checkclass.h | 3 +- lib/checkexceptionsafety.h | 3 +- lib/checkinternal.h | 3 +- lib/checkio.h | 3 +- lib/checkleakautovar.h | 5 +- lib/checkmemoryleak.h | 11 +- lib/checknonreentrantfunctions.h | 3 +- lib/checknullpointer.h | 3 +- lib/checkobsoletefunctions.h | 3 +- lib/checkother.h | 3 +- lib/checkpostfixoperator.h | 3 +- lib/checkstl.h | 3 +- lib/checkuninitvar.h | 3 +- lib/checkunusedfunctions.h | 5 +- lib/checkunusedvar.h | 3 +- lib/config.h | 16 ++ lib/cppcheck.h | 3 +- lib/cppcheck.vcxproj | 427 +++++++++++++++++++++++++++++++ lib/cppcheck.vcxproj.filters | 227 ++++++++++++++++ lib/errorlogger.h | 9 +- lib/executionpath.h | 3 +- lib/mathlib.h | 3 +- lib/path.h | 3 +- lib/preprocessor.h | 3 +- lib/settings.h | 5 +- lib/suppressions.h | 5 +- lib/symboldatabase.h | 9 +- lib/templatesimplifier.h | 3 +- lib/timer.h | 7 +- lib/token.h | 3 +- lib/tokenize.h | 3 +- lib/tokenlist.h | 3 +- test/testrunner.vcproj | 2 + test/testrunner.vcxproj | 411 +++++++++++++++-------------- test/testrunner.vcxproj.filters | 247 ++---------------- 46 files changed, 1386 insertions(+), 1023 deletions(-) create mode 100644 cli/cli.vcxproj create mode 100644 cli/cli.vcxproj.filters delete mode 100644 cli/cppcheck.vcxproj delete mode 100644 cli/cppcheck.vcxproj.filters create mode 100644 lib/config.h create mode 100644 lib/cppcheck.vcxproj create mode 100644 lib/cppcheck.vcxproj.filters diff --git a/cli/cli.vcxproj b/cli/cli.vcxproj new file mode 100644 index 000000000..b935ca103 --- /dev/null +++ b/cli/cli.vcxproj @@ -0,0 +1,247 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {35CBDF51-2456-3EC3-99ED-113C30858883} + cli + + + + debug\ + Application + temp\ + + + debug\ + Application + temp\ + + + release\ + Application + temp\ + + + release\ + Application + temp\ + + + + + + + + + + + + + + + + + + ..\bin\debug\ + ..\bin\debug\ + temp\debug\ + temp\debug\ + cppcheck + cppcheck + true + true + ..\bin\ + ..\bin\ + temp\ + temp\ + cppcheck + cppcheck + true + true + true + true + + + + ..\lib;..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories) + temp\ + false + true + ProgramDatabase + temp\ + Disabled + CPPCHECKLIB_IMPORT;UNICODE;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + false + .\ + MultiThreadedDebugDLL + true + Level4 + 4251 + + + shlwapi.lib;%(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + true + true + Console + true + $(TargetDir)cli.pdb + + + + + + ..\lib;..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories) + false + true + ProgramDatabase + Disabled + CPPCHECKLIB_IMPORT;UNICODE;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + false + MultiThreadedDebugDLL + true + Level4 + 4251 + false + + + shlwapi.lib;%(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + true + true + Console + true + $(TargetDir)cli.pdb + + + + + + ..\lib;..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories) + false + false + MaxSpeed + CPPCHECKLIB_IMPORT;NDEBUG;UNICODE;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + false + MultiThreadedDLL + true + Level4 + AnySuitable + true + Speed + true + false + 4251 + + + + + shlwapi.lib;%(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + false + true + Console + true + true + true + true + $(TargetDir)cli.pdb + + + + + + + + ..\lib;..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories) + false + false + MaxSpeed + CPPCHECKLIB_IMPORT;NDEBUG;UNICODE;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + false + MultiThreadedDLL + true + Level4 + AnySuitable + true + Speed + true + false + 4251 + + + true + + + shlwapi.lib;%(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + false + true + Console + true + true + true + true + $(TargetDir)cli.pdb + + + + + + + + + + + + + + + + + + + + + + + {c183db5b-ad6c-423d-80ca-1f9549555a1a} + true + true + false + true + false + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cli/cli.vcxproj.filters b/cli/cli.vcxproj.filters new file mode 100644 index 000000000..8ffe04c43 --- /dev/null +++ b/cli/cli.vcxproj.filters @@ -0,0 +1,86 @@ + + + + + {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} + cpp;c;cxx;moc;h;def;odl;idl;res + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Generated Files + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/cli/cppcheck.vcxproj b/cli/cppcheck.vcxproj deleted file mode 100644 index 92dfdfaa4..000000000 --- a/cli/cppcheck.vcxproj +++ /dev/null @@ -1,229 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {331ECF0E-B735-3591-8117-F947568F31EE} - cppcheck - Qt4VSv1.0 - - - - debug\ - false - NotSet - Application - temp\ - - - release\ - false - NotSet - Application - temp\ - - - - - - - - - - - - debug\ - temp\ - true - release\ - temp\ - true - false - - - - ".";"..\lib";"..\externals\tinyxml";..\..\..\..\Qt\4.8.1\mkspecs\win32-msvc2010;%(AdditionalIncludeDirectories) - -Zm200 -w34100 -w34189 %(AdditionalOptions) - temp\ - false - false - ProgramDatabase - Sync - temp\ - _CONSOLE;UNICODE;WIN32;QT_LARGEFILE_SUPPORT;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - false - .\ - MultiThreadedDebugDLL - true - true - false - Level4 - - - shlwapi.lib;%(AdditionalDependencies) - "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) - true - true - true - $(OutDir)\cppcheck.exe - true - Console - true - - - Unsigned - None - 0 - - - _CONSOLE;UNICODE;WIN32;QT_LARGEFILE_SUPPORT;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions) - - - - - ".";"..\lib";"..\externals\tinyxml";..\..\..\..\Qt\4.8.1\mkspecs\win32-msvc2010;%(AdditionalIncludeDirectories) - -Zm200 -w34100 -w34189 %(AdditionalOptions) - temp\ - false - false - Sync - temp\ - MaxSpeed - _CONSOLE;UNICODE;WIN32;QT_LARGEFILE_SUPPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions) - false - .\ - MultiThreadedDLL - true - true - false - Level4 - - - shlwapi.lib;%(AdditionalDependencies) - "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) - true - false - true - false - $(OutDir)\cppcheck.exe - true - Console - true - - - Unsigned - None - 0 - - - _CONSOLE;UNICODE;WIN32;QT_LARGEFILE_SUPPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/cli/cppcheck.vcxproj.filters b/cli/cppcheck.vcxproj.filters deleted file mode 100644 index cc6b67a5a..000000000 --- a/cli/cppcheck.vcxproj.filters +++ /dev/null @@ -1,302 +0,0 @@ - - - - - {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} - cpp;c;cxx;moc;h;def;odl;idl;res; - - - {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} - cpp;c;cxx;moc;h;def;odl;idl;res; - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Generated Files - - - - - - \ No newline at end of file diff --git a/cppcheck_vs2010.sln b/cppcheck_vs2010.sln index 0cd4fd1a5..080283497 100644 --- a/cppcheck_vs2010.sln +++ b/cppcheck_vs2010.sln @@ -1,29 +1,77 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual C++ Express 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cppcheck", "cli\cppcheck.vcxproj", "{00EC0553-4107-361D-9BF6-E01D402EDE8A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cli", "cli\cli.vcxproj", "{35CBDF51-2456-3EC3-99ED-113C30858883}" + ProjectSection(ProjectDependencies) = postProject + {C183DB5B-AD6C-423D-80CA-1F9549555A1A} = {C183DB5B-AD6C-423D-80CA-1F9549555A1A} + EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrunner", "test\testrunner.vcxproj", "{BFEBDA59-5448-3CF9-A3ED-7AAB0402CDE8}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrunner", "test\testrunner.vcxproj", "{4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}" + ProjectSection(ProjectDependencies) = postProject + {C183DB5B-AD6C-423D-80CA-1F9549555A1A} = {C183DB5B-AD6C-423D-80CA-1F9549555A1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cppcheck", "lib\cppcheck.vcxproj", "{C183DB5B-AD6C-423D-80CA-1F9549555A1A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 + Debug-PCRE|Win32 = Debug-PCRE|Win32 + Debug-PCRE|x64 = Debug-PCRE|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 + Release-PCRE|Win32 = Release-PCRE|Win32 + Release-PCRE|x64 = Release-PCRE|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {00EC0553-4107-361D-9BF6-E01D402EDE8A}.Debug|Win32.ActiveCfg = Debug|Win32 - {00EC0553-4107-361D-9BF6-E01D402EDE8A}.Debug|Win32.Build.0 = Debug|Win32 - {00EC0553-4107-361D-9BF6-E01D402EDE8A}.Debug|x64.ActiveCfg = Debug|Win32 - {00EC0553-4107-361D-9BF6-E01D402EDE8A}.Release|Win32.ActiveCfg = Release|Win32 - {00EC0553-4107-361D-9BF6-E01D402EDE8A}.Release|Win32.Build.0 = Release|Win32 - {00EC0553-4107-361D-9BF6-E01D402EDE8A}.Release|x64.ActiveCfg = Release|Win32 - {BFEBDA59-5448-3CF9-A3ED-7AAB0402CDE8}.Debug|Win32.ActiveCfg = Debug|Win32 - {BFEBDA59-5448-3CF9-A3ED-7AAB0402CDE8}.Debug|Win32.Build.0 = Debug|Win32 - {BFEBDA59-5448-3CF9-A3ED-7AAB0402CDE8}.Debug|x64.ActiveCfg = Debug|Win32 - {BFEBDA59-5448-3CF9-A3ED-7AAB0402CDE8}.Release|Win32.ActiveCfg = Release|Win32 - {BFEBDA59-5448-3CF9-A3ED-7AAB0402CDE8}.Release|Win32.Build.0 = Release|Win32 - {BFEBDA59-5448-3CF9-A3ED-7AAB0402CDE8}.Release|x64.ActiveCfg = Release|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Debug|Win32.ActiveCfg = Debug|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Debug|Win32.Build.0 = Debug|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Debug|x64.ActiveCfg = Debug|x64 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Debug|x64.Build.0 = Debug|x64 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Debug-PCRE|Win32.ActiveCfg = Debug|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Debug-PCRE|Win32.Build.0 = Debug|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Debug-PCRE|x64.ActiveCfg = Debug|x64 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Debug-PCRE|x64.Build.0 = Debug|x64 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Release|Win32.ActiveCfg = Release|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Release|Win32.Build.0 = Release|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Release|x64.ActiveCfg = Release|x64 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Release|x64.Build.0 = Release|x64 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Release-PCRE|Win32.ActiveCfg = Release|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Release-PCRE|Win32.Build.0 = Release|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Release-PCRE|x64.ActiveCfg = Release|x64 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Release-PCRE|x64.Build.0 = Release|x64 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Debug|Win32.ActiveCfg = Debug|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Debug|Win32.Build.0 = Debug|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Debug|x64.ActiveCfg = Debug|x64 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Debug|x64.Build.0 = Debug|x64 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Debug-PCRE|Win32.ActiveCfg = Debug|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Debug-PCRE|Win32.Build.0 = Debug|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Debug-PCRE|x64.ActiveCfg = Debug|x64 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Debug-PCRE|x64.Build.0 = Debug|x64 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Release|Win32.ActiveCfg = Release|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Release|Win32.Build.0 = Release|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Release|x64.ActiveCfg = Release|x64 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Release|x64.Build.0 = Release|x64 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Release-PCRE|Win32.ActiveCfg = Release|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Release-PCRE|Win32.Build.0 = Release|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Release-PCRE|x64.ActiveCfg = Release|x64 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Release-PCRE|x64.Build.0 = Release|x64 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Debug|Win32.ActiveCfg = Debug|Win32 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Debug|Win32.Build.0 = Debug|Win32 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Debug|x64.ActiveCfg = Debug|x64 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Debug|x64.Build.0 = Debug|x64 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Debug-PCRE|Win32.ActiveCfg = Debug-PCRE|Win32 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Debug-PCRE|Win32.Build.0 = Debug-PCRE|Win32 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Debug-PCRE|x64.ActiveCfg = Debug-PCRE|x64 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Debug-PCRE|x64.Build.0 = Debug-PCRE|x64 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Release|Win32.ActiveCfg = Release|Win32 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Release|Win32.Build.0 = Release|Win32 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Release|x64.ActiveCfg = Release|x64 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Release|x64.Build.0 = Release|x64 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Release-PCRE|Win32.ActiveCfg = Release-PCRE|Win32 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Release-PCRE|Win32.Build.0 = Release-PCRE|Win32 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Release-PCRE|x64.ActiveCfg = Release-PCRE|x64 + {C183DB5B-AD6C-423D-80CA-1F9549555A1A}.Release-PCRE|x64.Build.0 = Release-PCRE|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/lib/check.h b/lib/check.h index 3e03c27f3..f1d8013fd 100644 --- a/lib/check.h +++ b/lib/check.h @@ -19,6 +19,7 @@ #ifndef checkH #define checkH +#include "config.h" #include "token.h" #include "tokenize.h" #include "settings.h" @@ -35,7 +36,7 @@ * @brief Interface class that cppcheck uses to communicate with the checks. * All checking classes must inherit from this class */ -class Check { +class CPPCHECKLIB Check { public: /** This constructor is used when registering the CheckClass */ explicit Check(const std::string &aname); diff --git a/lib/check64bit.h b/lib/check64bit.h index 8ff3617c1..a60f09a3b 100644 --- a/lib/check64bit.h +++ b/lib/check64bit.h @@ -22,6 +22,7 @@ #define check64bitH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" @@ -32,7 +33,7 @@ * @brief Check for 64-bit portability issues */ -class Check64BitPortability : public Check { +class CPPCHECKLIB Check64BitPortability : public Check { public: /** This constructor is used when registering the Check64BitPortability */ Check64BitPortability() : Check(myName()) { diff --git a/lib/checkassignif.h b/lib/checkassignif.h index d4fdce5aa..508f1e743 100644 --- a/lib/checkassignif.h +++ b/lib/checkassignif.h @@ -22,6 +22,7 @@ #define checkassignifH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" #include "mathlib.h" @@ -32,7 +33,7 @@ * @brief Check for assignment / condition mismatches */ -class CheckAssignIf : public Check { +class CPPCHECKLIB CheckAssignIf : public Check { public: /** This constructor is used when registering the CheckAssignIf */ CheckAssignIf() : Check(myName()) { diff --git a/lib/checkautovariables.h b/lib/checkautovariables.h index ad39ca789..ea3d499bb 100644 --- a/lib/checkautovariables.h +++ b/lib/checkautovariables.h @@ -22,6 +22,7 @@ #define CheckAutoVariablesH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" #include "token.h" @@ -29,7 +30,7 @@ /// @{ -class CheckAutoVariables : public Check { +class CPPCHECKLIB CheckAutoVariables : public Check { public: /** This constructor is used when registering the CheckClass */ CheckAutoVariables() : Check(myName()) diff --git a/lib/checkboost.h b/lib/checkboost.h index e7995f253..8908509a5 100644 --- a/lib/checkboost.h +++ b/lib/checkboost.h @@ -22,6 +22,7 @@ #define CHECKBOOST_H //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" class Token; @@ -31,7 +32,7 @@ class Token; /** @brief %Check Boost usage */ -class CheckBoost : public Check { +class CPPCHECKLIB CheckBoost : public Check { public: /** This constructor is used when registering the CheckClass */ CheckBoost() : Check(myName()) diff --git a/lib/checkbufferoverrun.h b/lib/checkbufferoverrun.h index f58e565e3..55861678e 100644 --- a/lib/checkbufferoverrun.h +++ b/lib/checkbufferoverrun.h @@ -22,6 +22,7 @@ #define CheckBufferOverrunH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" #include "settings.h" #include "mathlib.h" @@ -46,7 +47,7 @@ class Variable; * I generally use 'buffer overrun' if you for example call a strcpy or * other function and pass a buffer and reads or writes too much data. */ -class CheckBufferOverrun : public Check { +class CPPCHECKLIB CheckBufferOverrun : public Check { public: /** This constructor is used when registering the CheckClass */ @@ -109,7 +110,7 @@ public: void negativeIndex(); /** Information about N-dimensional array */ - class ArrayInfo { + class CPPCHECKLIB ArrayInfo { private: /** number of elements of array */ std::vector _num; diff --git a/lib/checkclass.h b/lib/checkclass.h index ecff4c957..796fba57d 100644 --- a/lib/checkclass.h +++ b/lib/checkclass.h @@ -21,6 +21,7 @@ #define CheckClassH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" class Token; @@ -32,7 +33,7 @@ class Function; /** @brief %Check classes. Uninitialized member variables, non-conforming operators, missing virtual destructor, etc */ -class CheckClass : public Check { +class CPPCHECKLIB CheckClass : public Check { public: /** @brief This constructor is used when registering the CheckClass */ CheckClass() : Check(myName()), symbolDatabase(NULL) diff --git a/lib/checkexceptionsafety.h b/lib/checkexceptionsafety.h index fc8661f63..48a0145fc 100644 --- a/lib/checkexceptionsafety.h +++ b/lib/checkexceptionsafety.h @@ -21,6 +21,7 @@ #define checkexceptionsafetyH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" #include "settings.h" @@ -39,7 +40,7 @@ class Token; * that certain variable values are corrupt. */ -class CheckExceptionSafety : public Check { +class CPPCHECKLIB CheckExceptionSafety : public Check { public: /** This constructor is used when registering the CheckClass */ CheckExceptionSafety() : Check(myName()) diff --git a/lib/checkinternal.h b/lib/checkinternal.h index 037f6dabb..ac02ab9b7 100644 --- a/lib/checkinternal.h +++ b/lib/checkinternal.h @@ -23,6 +23,7 @@ //--------------------------------------------------------------------------- #include "check.h" +#include "config.h" class Token; @@ -31,7 +32,7 @@ class Token; /** @brief %Check Internal cppcheck API usage */ -class CheckInternal : public Check { +class CPPCHECKLIB CheckInternal : public Check { public: /** This constructor is used when registering the CheckClass */ CheckInternal() : Check(myName()) diff --git a/lib/checkio.h b/lib/checkio.h index 7700fd9b8..002874c97 100644 --- a/lib/checkio.h +++ b/lib/checkio.h @@ -22,13 +22,14 @@ //--------------------------------------------------------------------------- #include "check.h" +#include "config.h" /// @addtogroup Checks /// @{ /** @brief %Check input output operations. */ -class CheckIO : public Check { +class CPPCHECKLIB CheckIO : public Check { public: /** @brief This constructor is used when registering CheckIO */ CheckIO() : Check(myName()) diff --git a/lib/checkleakautovar.h b/lib/checkleakautovar.h index 949b11f65..303e658aa 100644 --- a/lib/checkleakautovar.h +++ b/lib/checkleakautovar.h @@ -22,10 +22,11 @@ #define checkleakautovarH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" -class VarInfo { +class CPPCHECKLIB VarInfo { public: std::map alloctype; std::map possibleUsage; @@ -63,7 +64,7 @@ public: * @brief Check for leaks */ -class CheckLeakAutoVar : public Check { +class CPPCHECKLIB CheckLeakAutoVar : public Check { public: /** This constructor is used when registering the CheckLeakAutoVar */ CheckLeakAutoVar() : Check(myName()) { diff --git a/lib/checkmemoryleak.h b/lib/checkmemoryleak.h index cc55d86b6..cb223decc 100644 --- a/lib/checkmemoryleak.h +++ b/lib/checkmemoryleak.h @@ -34,6 +34,7 @@ * - CheckMemoryLeakStructMember checks allocation/deallocation of structs and struct members */ +#include "config.h" #include "check.h" #include @@ -48,7 +49,7 @@ class Variable; /// @{ /** @brief Base class for memory leaks checking */ -class CheckMemoryLeak { +class CPPCHECKLIB CheckMemoryLeak { private: /** For access to the tokens */ const Tokenizer * const tokenizer; @@ -181,7 +182,7 @@ public: * -# finally, check if the simplified token list contain any leaks. */ -class CheckMemoryLeakInFunction : private Check, public CheckMemoryLeak { +class CPPCHECKLIB CheckMemoryLeakInFunction : private Check, public CheckMemoryLeak { public: /** @brief This constructor is used when registering this class */ CheckMemoryLeakInFunction() : Check(myName()), CheckMemoryLeak(0, 0, Standards()), symbolDatabase(NULL) @@ -351,7 +352,7 @@ private: * @brief %Check class variables, variables that are allocated in the constructor should be deallocated in the destructor */ -class CheckMemoryLeakInClass : private Check, private CheckMemoryLeak { +class CPPCHECKLIB CheckMemoryLeakInClass : private Check, private CheckMemoryLeak { public: CheckMemoryLeakInClass() : Check(myName()), CheckMemoryLeak(0, 0, Standards()) { } @@ -394,7 +395,7 @@ private: /** @brief detect simple memory leaks for struct members */ -class CheckMemoryLeakStructMember : private Check, private CheckMemoryLeak { +class CPPCHECKLIB CheckMemoryLeakStructMember : private Check, private CheckMemoryLeak { public: CheckMemoryLeakStructMember() : Check(myName()), CheckMemoryLeak(0, 0, Standards()) { } @@ -433,7 +434,7 @@ private: /** @brief detect simple memory leaks (address not taken) */ -class CheckMemoryLeakNoVar : private Check, private CheckMemoryLeak { +class CPPCHECKLIB CheckMemoryLeakNoVar : private Check, private CheckMemoryLeak { public: CheckMemoryLeakNoVar() : Check(myName()), CheckMemoryLeak(0, 0, Standards()) { } diff --git a/lib/checknonreentrantfunctions.h b/lib/checknonreentrantfunctions.h index 0ae0714e5..60326353b 100644 --- a/lib/checknonreentrantfunctions.h +++ b/lib/checknonreentrantfunctions.h @@ -22,6 +22,7 @@ #define CheckNonReentrantFunctionsH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" #include #include @@ -34,7 +35,7 @@ * @brief Using non reentrant functions that can be replaced by their reentrant versions */ -class CheckNonReentrantFunctions : public Check { +class CPPCHECKLIB CheckNonReentrantFunctions : public Check { public: /** This constructor is used when registering the CheckNonReentrantFunctions */ CheckNonReentrantFunctions() : Check(myName()) { diff --git a/lib/checknullpointer.h b/lib/checknullpointer.h index 8c13eb10e..c4b25a2de 100644 --- a/lib/checknullpointer.h +++ b/lib/checknullpointer.h @@ -22,6 +22,7 @@ #define checknullpointerH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" #include "settings.h" @@ -34,7 +35,7 @@ class SymbolDatabase; /** @brief check for null pointer dereferencing */ -class CheckNullPointer : public Check { +class CPPCHECKLIB CheckNullPointer : public Check { public: /** @brief This constructor is used when registering the CheckNullPointer */ CheckNullPointer() : Check(myName()) diff --git a/lib/checkobsoletefunctions.h b/lib/checkobsoletefunctions.h index 2a6271626..7fe5c02fe 100644 --- a/lib/checkobsoletefunctions.h +++ b/lib/checkobsoletefunctions.h @@ -22,6 +22,7 @@ #define CheckObsoleteFunctionsH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" #include #include @@ -34,7 +35,7 @@ * @brief Using obsolete functions that are always insecure to use. */ -class CheckObsoleteFunctions : public Check { +class CPPCHECKLIB CheckObsoleteFunctions : public Check { public: /** This constructor is used when registering the CheckObsoleteFunctions */ CheckObsoleteFunctions() : Check(myName()) { diff --git a/lib/checkother.h b/lib/checkother.h index edcd1b724..ac2c35b87 100644 --- a/lib/checkother.h +++ b/lib/checkother.h @@ -22,6 +22,7 @@ #define CheckOtherH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" #include "settings.h" @@ -35,7 +36,7 @@ class Variable; /** @brief Various small checks */ -class CheckOther : public Check { +class CPPCHECKLIB CheckOther : public Check { public: /** @brief This constructor is used when registering the CheckClass */ CheckOther() : Check(myName()) diff --git a/lib/checkpostfixoperator.h b/lib/checkpostfixoperator.h index c71e3ae3a..cdb086ec0 100644 --- a/lib/checkpostfixoperator.h +++ b/lib/checkpostfixoperator.h @@ -22,6 +22,7 @@ #define CheckPostfixOperatorH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" /// @addtogroup Checks @@ -31,7 +32,7 @@ * @brief Using postfix operators ++ or -- rather than postfix operator. */ -class CheckPostfixOperator : public Check { +class CPPCHECKLIB CheckPostfixOperator : public Check { public: /** This constructor is used when registering the CheckPostfixOperator */ CheckPostfixOperator() : Check(myName()) diff --git a/lib/checkstl.h b/lib/checkstl.h index 8b20af7c9..a8de9b7f7 100644 --- a/lib/checkstl.h +++ b/lib/checkstl.h @@ -22,6 +22,7 @@ #define checkstlH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" class Token; @@ -31,7 +32,7 @@ class Token; /** @brief %Check STL usage (invalidation of iterators, mismatching containers, etc) */ -class CheckStl : public Check { +class CPPCHECKLIB CheckStl : public Check { public: /** This constructor is used when registering the CheckClass */ CheckStl() : Check(myName()) diff --git a/lib/checkuninitvar.h b/lib/checkuninitvar.h index c0b182eb8..3a522ff3b 100644 --- a/lib/checkuninitvar.h +++ b/lib/checkuninitvar.h @@ -22,6 +22,7 @@ #define checkuninitvarH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" #include "settings.h" @@ -35,7 +36,7 @@ class Variable; /** @brief Checking for uninitialized variables */ -class CheckUninitVar : public Check { +class CPPCHECKLIB CheckUninitVar : public Check { public: /** @brief This constructor is used when registering the CheckUninitVar */ CheckUninitVar() : Check(myName()) diff --git a/lib/checkunusedfunctions.h b/lib/checkunusedfunctions.h index a8c9a441d..dedf7f7e3 100644 --- a/lib/checkunusedfunctions.h +++ b/lib/checkunusedfunctions.h @@ -22,6 +22,7 @@ #define checkunusedfunctionsH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" #include "tokenize.h" #include "errorlogger.h" @@ -29,7 +30,7 @@ /// @addtogroup Checks /// @{ -class CheckUnusedFunctions: public Check { +class CPPCHECKLIB CheckUnusedFunctions: public Check { public: /** @brief This constructor is used when registering the CheckUnusedFunctions */ CheckUnusedFunctions() : Check(myName()), templates(false) @@ -76,7 +77,7 @@ private: return "Check for functions that are never called\n"; } - class FunctionUsage { + class CPPCHECKLIB FunctionUsage { public: FunctionUsage() : lineNumber(0), usedSameFile(false), usedOtherFile(false) { } diff --git a/lib/checkunusedvar.h b/lib/checkunusedvar.h index eabca9e0c..1d3503cea 100644 --- a/lib/checkunusedvar.h +++ b/lib/checkunusedvar.h @@ -22,6 +22,7 @@ #define CheckUnusedVarH //--------------------------------------------------------------------------- +#include "config.h" #include "check.h" #include "settings.h" @@ -35,7 +36,7 @@ class Variables; /** @brief Various small checks */ -class CheckUnusedVar : public Check { +class CPPCHECKLIB CheckUnusedVar : public Check { public: /** @brief This constructor is used when registering the CheckClass */ CheckUnusedVar() : Check(myName()) diff --git a/lib/config.h b/lib/config.h new file mode 100644 index 000000000..bc545d049 --- /dev/null +++ b/lib/config.h @@ -0,0 +1,16 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#ifdef _WIN32 +# ifdef CPPCHECKLIB_EXPORT +# define CPPCHECKLIB __declspec(dllexport) +# elif defined(CPPCHECKLIB_IMPORT) +# define CPPCHECKLIB __declspec(dllimport) +# else +# define CPPCHECKLIB +# endif +#else +# define CPPCHECKLIB +#endif + +#endif \ No newline at end of file diff --git a/lib/cppcheck.h b/lib/cppcheck.h index 0ea07cd6e..2bc915643 100644 --- a/lib/cppcheck.h +++ b/lib/cppcheck.h @@ -19,6 +19,7 @@ #ifndef CPPCHECK_H #define CPPCHECK_H +#include "config.h" #include "settings.h" #include "errorlogger.h" #include "checkunusedfunctions.h" @@ -36,7 +37,7 @@ * errors or places that could be improved. * Usage: See check() for more info. */ -class CppCheck : ErrorLogger { +class CPPCHECKLIB CppCheck : ErrorLogger { public: /** * @brief Constructor. diff --git a/lib/cppcheck.vcxproj b/lib/cppcheck.vcxproj new file mode 100644 index 000000000..f64b9db03 --- /dev/null +++ b/lib/cppcheck.vcxproj @@ -0,0 +1,427 @@ + + + + + Debug-PCRE + Win32 + + + Debug-PCRE + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release-PCRE + Win32 + + + Release-PCRE + x64 + + + Release + Win32 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {C183DB5B-AD6C-423D-80CA-1F9549555A1A} + cppcheck_lib + + + + debug\ + DynamicLibrary + temp\ + + + debug\ + DynamicLibrary + temp\ + + + debug\ + DynamicLibrary + temp\ + + + debug\ + DynamicLibrary + temp\ + + + release\ + DynamicLibrary + temp\ + + + release\ + DynamicLibrary + temp\ + + + release\ + DynamicLibrary + temp\ + + + release\ + DynamicLibrary + temp\ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ..\bin\debug\ + ..\bin\debug\ + ..\bin\debug\ + ..\bin\debug\ + temp\debug\ + temp\debug\ + temp\debug\ + temp\debug\ + cppcheck + cppcheck + cppcheck + cppcheck + false + false + false + false + ..\bin\ + ..\bin\ + ..\bin\ + ..\bin\ + temp\ + temp\ + temp\ + temp\ + cppcheck + cppcheck + cppcheck + cppcheck + false + false + false + false + true + true + true + true + + + + ProgramDatabase + true + temp\ + Disabled + CPPCHECKLIB_EXPORT;UNICODE;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + Level4 + ..\externals;%(AdditionalIncludeDirectories) + 4251 + MultiThreadedDebugDLL + + + %(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + true + true + true + false + + + + + + ProgramDatabase + true + temp\ + Disabled + CPPCHECKLIB_EXPORT;UNICODE;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + Level4 + ..\externals;%(AdditionalIncludeDirectories) + 4251 + MultiThreadedDebugDLL + + + ../externals\pcre.lib;%(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + true + true + true + false + + + + + + ProgramDatabase + true + temp\ + Disabled + CPPCHECKLIB_EXPORT;UNICODE;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + Level4 + ..\externals;%(AdditionalIncludeDirectories) + 4251 + MultiThreadedDebugDLL + false + + + %(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + true + true + true + false + + + + + + ProgramDatabase + true + temp\ + Disabled + CPPCHECKLIB_EXPORT;UNICODE;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + Level4 + ..\externals;%(AdditionalIncludeDirectories) + 4251 + MultiThreadedDebugDLL + false + + + ../externals\pcre.lib;%(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + true + true + true + false + + + + + + MaxSpeed + Level4 + AnySuitable + true + Speed + true + false + ..\externals;%(AdditionalIncludeDirectories) + 4251 + CPPCHECKLIB_EXPORT;NDEBUG;UNICODE;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + MultiThreadedDLL + false + + + true + + + %(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + false + true + true + true + + + + + + MaxSpeed + Level4 + AnySuitable + true + Speed + true + false + ..\externals;%(AdditionalIncludeDirectories) + 4251 + CPPCHECKLIB_EXPORT;NDEBUG;UNICODE;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + MultiThreadedDLL + false + + + true + + + ../externals\pcre.lib;%(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + false + true + true + true + + + + + + MaxSpeed + Level4 + AnySuitable + true + Speed + true + false + ..\externals;%(AdditionalIncludeDirectories) + 4251 + CPPCHECKLIB_EXPORT;NDEBUG;UNICODE;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + MultiThreadedDLL + false + + + true + true + + + %(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + false + true + true + true + + + + + + MaxSpeed + Level4 + AnySuitable + true + Speed + true + false + ..\externals;%(AdditionalIncludeDirectories) + 4251 + CPPCHECKLIB_EXPORT;NDEBUG;UNICODE;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + MultiThreadedDLL + false + + + true + true + + + ../externals\pcre.lib;%(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + false + true + true + true + + + + + + \ No newline at end of file diff --git a/lib/cppcheck.vcxproj.filters b/lib/cppcheck.vcxproj.filters new file mode 100644 index 000000000..be9799909 --- /dev/null +++ b/lib/cppcheck.vcxproj.filters @@ -0,0 +1,227 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/lib/errorlogger.h b/lib/errorlogger.h index 9f6c07fad..601ed41cd 100644 --- a/lib/errorlogger.h +++ b/lib/errorlogger.h @@ -23,6 +23,7 @@ #include #include +#include "config.h" #include "suppressions.h" class Token; @@ -32,7 +33,7 @@ class TokenList; /// @{ /** @brief enum class for severity. Used when reporting errors. */ -class Severity { +class CPPCHECKLIB Severity { public: /** * Message severities. @@ -137,20 +138,20 @@ public: * @brief This is an interface, which the class responsible of error logging * should implement. */ -class ErrorLogger { +class CPPCHECKLIB ErrorLogger { public: /** * Wrapper for error messages, provided by reportErr() */ - class ErrorMessage { + class CPPCHECKLIB ErrorMessage { public: /** * File name and line number. * Internally paths are stored with / separator. When getting the filename * it is by default converted to native separators. */ - class FileLocation { + class CPPCHECKLIB FileLocation { public: FileLocation() : line(0) { diff --git a/lib/executionpath.h b/lib/executionpath.h index 68fe4de63..e9873855d 100644 --- a/lib/executionpath.h +++ b/lib/executionpath.h @@ -20,6 +20,7 @@ #define executionpathH #include +#include "config.h" class Token; class Check; @@ -29,7 +30,7 @@ class SymbolDatabase; * Base class for Execution Paths checking * An execution path is a linear list of statements. There are no "if"/.. to worry about. **/ -class ExecutionPath { +class CPPCHECKLIB ExecutionPath { private: /** No implementation */ void operator=(const ExecutionPath &); diff --git a/lib/mathlib.h b/lib/mathlib.h index c584f8d0d..5a99bddf6 100644 --- a/lib/mathlib.h +++ b/lib/mathlib.h @@ -22,13 +22,14 @@ #include #include +#include "config.h" /// @addtogroup Core /// @{ /** @brief simple math functions that uses operands stored in std::string. useful when performing math on tokens. */ -class MathLib { +class CPPCHECKLIB MathLib { public: typedef long long bigint; diff --git a/lib/path.h b/lib/path.h index 8b319a4ec..5a5306233 100644 --- a/lib/path.h +++ b/lib/path.h @@ -21,6 +21,7 @@ #include #include +#include "config.h" /// @addtogroup Core /// @{ @@ -32,7 +33,7 @@ * native separator for Unix-derived systems. When giving path to user * or for other functions we convert path separators back to native type. */ -class Path { +class CPPCHECKLIB Path { public: /** * Convert path to use native separators. diff --git a/lib/preprocessor.h b/lib/preprocessor.h index 461269601..445952e18 100644 --- a/lib/preprocessor.h +++ b/lib/preprocessor.h @@ -25,6 +25,7 @@ #include #include #include +#include "config.h" class ErrorLogger; class Settings; @@ -37,7 +38,7 @@ class Settings; * The preprocessor has special functionality for extracting the various ifdef * configurations that exist in a source file. */ -class Preprocessor { +class CPPCHECKLIB Preprocessor { public: /** diff --git a/lib/settings.h b/lib/settings.h index 4c93960ef..3cb13eca5 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -23,6 +23,7 @@ #include #include #include +#include "config.h" #include "suppressions.h" #include "standards.h" @@ -35,7 +36,7 @@ * to pass individual values to functions or constructors now or in the * future when we might have even more detailed settings. */ -class Settings { +class CPPCHECKLIB Settings { private: /** @brief Code to append in the checks */ std::string _append; @@ -165,7 +166,7 @@ public: #ifdef HAVE_RULES /** Rule */ - class Rule { + class CPPCHECKLIB Rule { public: Rule() : id("rule") // default id diff --git a/lib/suppressions.h b/lib/suppressions.h index 3abdc37d1..5c87725cc 100644 --- a/lib/suppressions.h +++ b/lib/suppressions.h @@ -23,14 +23,15 @@ #include #include #include +#include "config.h" /// @addtogroup Core /// @{ /** @brief class for handling suppressions */ -class Suppressions { +class CPPCHECKLIB Suppressions { private: - class FileMatcher { + class CPPCHECKLIB FileMatcher { friend class Suppressions; private: /** @brief List of filenames suppressed, bool flag indicates whether suppression matched. */ diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index 015bdd250..26a2eab75 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -26,6 +26,7 @@ #include #include +#include "config.h" #include "token.h" #include "mathlib.h" @@ -53,7 +54,7 @@ struct Dimension { }; /** @brief Information about a member variable. */ -class Variable { +class CPPCHECKLIB Variable { /** @brief flags mask used to access specific bit. */ enum { fIsMutable = (1 << 0), /** @brief mutable variable */ @@ -357,7 +358,7 @@ private: void evaluate(); }; -class Function { +class CPPCHECKLIB Function { public: enum Type { eConstructor, eCopyConstructor, eOperatorEqual, eDestructor, eFunction }; @@ -417,7 +418,7 @@ private: bool isImplicitlyVirtual_rec(const Scope* scope, bool& safe) const; }; -class Scope { +class CPPCHECKLIB Scope { // let tests access private function for testing friend class TestSymbolDatabase; @@ -538,7 +539,7 @@ private: bool isVariableDeclaration(const Token* tok, const Token*& vartok, const Token*& typetok) const; }; -class SymbolDatabase { +class CPPCHECKLIB SymbolDatabase { public: SymbolDatabase(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger); diff --git a/lib/templatesimplifier.h b/lib/templatesimplifier.h index 1585ab468..693bf007c 100644 --- a/lib/templatesimplifier.h +++ b/lib/templatesimplifier.h @@ -26,6 +26,7 @@ #include #include #include +#include "config.h" class Token; class TokenList; @@ -37,7 +38,7 @@ class Settings; /// @{ /** @brief Simplify templates from the preprocessed and partially simplified code. */ -class TemplateSimplifier { +class CPPCHECKLIB TemplateSimplifier { TemplateSimplifier(); ~TemplateSimplifier(); public: diff --git a/lib/timer.h b/lib/timer.h index 057c7d67d..fe8760f06 100644 --- a/lib/timer.h +++ b/lib/timer.h @@ -22,6 +22,7 @@ #include #include #include +#include "config.h" enum { SHOWTIME_NONE = 0, @@ -30,7 +31,7 @@ enum { SHOWTIME_TOP5 }; -class TimerResultsIntf { +class CPPCHECKLIB TimerResultsIntf { public: virtual ~TimerResultsIntf() { } @@ -47,7 +48,7 @@ struct TimerResultsData { } }; -class TimerResults : public TimerResultsIntf { +class CPPCHECKLIB TimerResults : public TimerResultsIntf { public: TimerResults() { } @@ -59,7 +60,7 @@ private: std::map _results; }; -class Timer { +class CPPCHECKLIB Timer { public: Timer(const std::string& str, unsigned int showtimeMode, TimerResultsIntf* timerResults = NULL); ~Timer(); diff --git a/lib/token.h b/lib/token.h index e20a1f617..82479de40 100644 --- a/lib/token.h +++ b/lib/token.h @@ -22,6 +22,7 @@ #include #include #include +#include "config.h" /// @addtogroup Core /// @{ @@ -36,7 +37,7 @@ * * The Token class also has other functions for management of token list, matching tokens, etc. */ -class Token { +class CPPCHECKLIB Token { private: Token **tokensBack; diff --git a/lib/tokenize.h b/lib/tokenize.h index da737291d..c3af9557e 100644 --- a/lib/tokenize.h +++ b/lib/tokenize.h @@ -24,6 +24,7 @@ #include "errorlogger.h" #include "tokenlist.h" +#include "config.h" #include #include @@ -37,7 +38,7 @@ class TimerResults; /// @{ /** @brief The main purpose is to tokenize the source code. It also has functions that simplify the token list */ -class Tokenizer { +class CPPCHECKLIB Tokenizer { public: Tokenizer(); Tokenizer(const Settings * settings, ErrorLogger *errorLogger); diff --git a/lib/tokenlist.h b/lib/tokenlist.h index a71e473e9..f423540e2 100644 --- a/lib/tokenlist.h +++ b/lib/tokenlist.h @@ -24,6 +24,7 @@ #include #include +#include "config.h" class Token; class Settings; @@ -31,7 +32,7 @@ class Settings; /// @addtogroup Core /// @{ -class TokenList { +class CPPCHECKLIB TokenList { public: TokenList(const Settings* settings); ~TokenList(); diff --git a/test/testrunner.vcproj b/test/testrunner.vcproj index 085fd49a2..8b3959877 100644 --- a/test/testrunner.vcproj +++ b/test/testrunner.vcproj @@ -223,6 +223,8 @@ RelativePath="testfilelister.cpp" /> + + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + + + + + {c183db5b-ad6c-423d-80ca-1f9549555a1a} + true + true + false + true + false + - - {2008CD60-EE28-3AB7-B069-21CB292ED3B3} - testrunner - Qt4VSv1.0 - - - - debug\ - false - NotSet - Application - temp\ - - - release\ - false - NotSet - Application - temp\ - - - - - - - - - - - - debug\ - temp\ - true - release\ - temp\ - true - false - - - - ".";"..\cli";"..\lib";"..\externals\tinyxml";..\..\..\..\Qt\4.8.1\mkspecs\win32-msvc2010;%(AdditionalIncludeDirectories) - -Zm200 -w34100 -w34189 %(AdditionalOptions) - temp\ - false - false - ProgramDatabase - Sync - temp\ - _CONSOLE;UNICODE;WIN32;QT_LARGEFILE_SUPPORT;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - false - .\ - MultiThreadedDebugDLL - true - true - false - Level4 - - - shlwapi.lib;%(AdditionalDependencies) - "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) - true - true - true - $(OutDir)\testrunner.exe - true - Console - true - - - Unsigned - None - 0 - - - _CONSOLE;UNICODE;WIN32;QT_LARGEFILE_SUPPORT;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions) - - - - - ".";"..\cli";"..\lib";"..\externals\tinyxml";..\..\..\..\Qt\4.8.1\mkspecs\win32-msvc2010;%(AdditionalIncludeDirectories) - -Zm200 -w34100 -w34189 %(AdditionalOptions) - temp\ - false - false - Sync - temp\ - MaxSpeed - _CONSOLE;UNICODE;WIN32;QT_LARGEFILE_SUPPORT;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions) - false - .\ - MultiThreadedDLL - true - true - false - Level4 - - - shlwapi.lib;%(AdditionalDependencies) - "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) - true - false - true - false - $(OutDir)\testrunner.exe - true - Console - true - - - Unsigned - None - 0 - - - _CONSOLE;UNICODE;WIN32;QT_LARGEFILE_SUPPORT;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - @@ -178,6 +52,7 @@ + @@ -202,63 +77,201 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4} + testrunner + + + + debug\ + Application + temp\ + + + debug\ + Application + temp\ + + + release\ + Application + temp\ + + + release\ + Application + temp\ + + + + + + + + + + + + + + + + + + ..\bin\debug\ + ..\bin\debug\ + temp\debug\ + temp\debug\ + testrunner + testrunner + true + true + ..\bin\ + ..\bin\ + temp\ + temp\ + testrunner + testrunner + true + true + true + true + + + + ..\cli;..\lib;..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories) + false + true + ProgramDatabase + Disabled + CPPCHECKLIB_IMPORT;UNICODE;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + false + MultiThreadedDebugDLL + true + Level4 + 4251 + + + shlwapi.lib;%(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + true + true + true + Console + true + + + + + + ..\cli;..\lib;..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories) + false + true + ProgramDatabase + Disabled + CPPCHECKLIB_IMPORT;UNICODE;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + false + MultiThreadedDebugDLL + true + Level4 + 4251 + false + + + shlwapi.lib;%(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + true + true + true + Console + true + + + + + + ..\cli;..\lib;..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories) + false + false + MaxSpeed + CPPCHECKLIB_IMPORT;NDEBUG;UNICODE;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + false + MultiThreadedDLL + true + Level4 + AnySuitable + true + Speed + true + 4251 + false + + + + + shlwapi.lib;%(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + true + false + true + Console + true + true + true + true + + + + + + + ..\cli;..\lib;..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories) + false + false + MaxSpeed + CPPCHECKLIB_IMPORT;NDEBUG;UNICODE;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + false + MultiThreadedDLL + true + Level4 + AnySuitable + true + Speed + true + 4251 + false + + + true + + + shlwapi.lib;%(AdditionalDependencies) + ../externals;%(AdditionalLibraryDirectories) + true + false + true + Console + true + true + true + true + + + \ No newline at end of file diff --git a/test/testrunner.vcxproj.filters b/test/testrunner.vcxproj.filters index d316fa99f..4d2ae0e69 100644 --- a/test/testrunner.vcxproj.filters +++ b/test/testrunner.vcxproj.filters @@ -1,4 +1,4 @@ - + @@ -19,111 +19,9 @@ - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - Source Files - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - Source Files @@ -133,9 +31,6 @@ Source Files - - Source Files - Source Files @@ -241,10 +136,16 @@ Source Files + + Source Files + + + Source Files + Source Files - + Source Files @@ -259,135 +160,33 @@ Source Files - - Source Files - - - Source Files - - + Source Files - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - Header Files - - Header Files - - - Header Files - - - Header Files - Header Files - - Header Files - - - Header Files - - - Header Files - - - Header Files - Header Files + + Header Files + + + Header Files + + + Header Files + Header Files - + Header Files @@ -396,13 +195,7 @@ Header Files - - Header Files - - - Header Files - - + Header Files