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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions cli/cli.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>$(TargetDir)cli.pdb</ProgramDatabaseFile>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|Win32'">
Expand All @@ -202,6 +204,8 @@
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand All @@ -225,6 +229,8 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">
Expand All @@ -248,6 +254,8 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down Expand Up @@ -282,6 +290,8 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|Win32'">
Expand Down Expand Up @@ -316,6 +326,8 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down Expand Up @@ -350,6 +362,8 @@
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">
Expand Down Expand Up @@ -384,6 +398,8 @@
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions cmake/compileroptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND
set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -U_GLIBCXX_DEBUG")
endif()

if (MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:8000000")
endif()

include(cmake/dynamic_analyzer_options.cmake REQUIRED)

# Add user supplied extra options (optimization, etc...)
Expand Down
6 changes: 2 additions & 4 deletions lib/checkleakautovar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,8 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken,
std::set<unsigned int> notzero,
unsigned int recursiveCount)
{
// The C++ standard suggests a minimum of 256 nested control statements
// but MSVC has a limit of 100.
if (++recursiveCount > 100)
throw InternalError(startToken, "Internal limit: CheckLeakAutoVar::checkScope() Maximum recursive count of 100 reached.", InternalError::LIMIT);
if (++recursiveCount > 1000) // maximum number of "else if ()"
throw InternalError(startToken, "Internal limit: CheckLeakAutoVar::checkScope() Maximum recursive count of 1000 reached.", InternalError::LIMIT);

std::map<unsigned int, VarInfo::AllocInfo> &alloctype = varInfo->alloctype;
std::map<unsigned int, std::string> &possibleUsage = varInfo->possibleUsage;
Expand Down
16 changes: 16 additions & 0 deletions lib/cppcheck.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
Expand Down Expand Up @@ -323,6 +325,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
Expand All @@ -349,6 +353,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
Expand Down Expand Up @@ -376,6 +382,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
Expand Down Expand Up @@ -414,6 +422,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
Expand Down Expand Up @@ -453,6 +463,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
Expand Down Expand Up @@ -490,6 +502,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
Expand Down Expand Up @@ -528,6 +542,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
Expand Down
4 changes: 2 additions & 2 deletions test/testleakautovar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1823,15 +1823,15 @@ class TestLeakAutoVar : public TestFixture {
"#define THOU HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN\n"
"void foo() {\n"
" if (0) { }\n"
" THOU\n"
" THOU THOU\n"
"}"), InternalError);
ASSERT_NO_THROW(checkP("#define ONE if (0) { }\n"
"#define TEN ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE\n"
"#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN\n"
"#define THOU HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN\n"
"void foo() {\n"
" if (0) { }\n"
" THOU\n"
" THOU THOU\n"
"}"));
}

Expand Down
8 changes: 8 additions & 0 deletions test/testrunner.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand All @@ -221,6 +223,8 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down Expand Up @@ -259,6 +263,8 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down Expand Up @@ -298,6 +304,8 @@
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down