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
5 changes: 0 additions & 5 deletions cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@
*/
int main(int argc, char* argv[])
{
// MS Visual C++ memory leak debug tracing
#if defined(_MSC_VER) && defined(_DEBUG)
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
#endif

CppCheckExecutor exec;

// *INDENT-OFF*
Expand Down
4 changes: 0 additions & 4 deletions cmake/compilerDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ if(DISALLOW_PROCESS_EXECUTOR)
add_definitions(-DDISALLOW_PROCESS_EXECUTOR)
endif()

if(MSVC AND DISABLE_CRTDBG_MAP_ALLOC)
add_definitions(-DDISABLE_CRTDBG_MAP_ALLOC)
endif()

if(NO_UNIX_SIGNAL_HANDLING)
add_definitions(-DNO_UNIX_SIGNAL_HANDLING)
endif()
Expand Down
9 changes: 0 additions & 9 deletions cmake/findDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ if(BUILD_GUI)
message(WARNING "'Qt6Core_VERSION' is not set - using 6.0.0 as fallback")
set(QT_VERSION "6.0.0")
endif()
if(MSVC)
# disable Visual Studio C++ memory leak detection since it causes compiler errors with Qt 6
# D:\a\cppcheck\Qt\6.2.4\msvc2019_64\include\QtCore/qhash.h(179,15): warning C4003: not enough arguments for function-like macro invocation 'free' [D:\a\cppcheck\cppcheck\build\gui\cppcheck-gui.vcxproj]
# D:\a\cppcheck\Qt\6.2.4\msvc2019_64\include\QtCore/qhash.h(179,15): error C2059: syntax error: ',' [D:\a\cppcheck\cppcheck\build\gui\cppcheck-gui.vcxproj]
# this is supposed to be fixed according to the following tickets but it still happens
# https://bugreports.qt.io/browse/QTBUG-40575
# https://bugreports.qt.io/browse/QTBUG-86395
set(DISABLE_CRTDBG_MAP_ALLOC ON)
endif()

if(BUILD_ONLINE_HELP)
find_program(QHELPGENERATOR qhelpgenerator)
Expand Down
1 change: 0 additions & 1 deletion cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ if (NOT USE_BOOST AND USE_BOOST_INT128)
endif()
option(USE_LIBCXX "Use libc++ instead of libstdc++" OFF)

option(DISABLE_CRTDBG_MAP_ALLOC "Disable usage of Visual Studio C++ memory leak detection in Debug build" OFF)
option(NO_UNIX_SIGNAL_HANDLING "Disable usage of Unix Signal Handling" OFF)
option(NO_UNIX_BACKTRACE_SUPPORT "Disable usage of Unix Backtrace support" OFF)
option(NO_WINDOWS_SEH "Disable usage of Windows SEH" OFF)
Expand Down
1 change: 0 additions & 1 deletion cmake/printInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ message(STATUS)
message(STATUS "USE_MATCHCOMPILER = ${USE_MATCHCOMPILER}")
message(STATUS "USE_MATCHCOMPILER_OPT = ${USE_MATCHCOMPILER_OPT}")
message(STATUS)
message(STATUS "DISABLE_CRTDBG_MAP_ALLOC = ${DISABLE_CRTDBG_MAP_ALLOC}")
message(STATUS "NO_UNIX_SIGNAL_HANDLING = ${NO_UNIX_SIGNAL_HANDLING}")
message(STATUS "NO_UNIX_BACKTRACE_SUPPORT = ${NO_UNIX_BACKTRACE_SUPPORT}")
message(STATUS "NO_WINDOWS_SEH = ${NO_WINDOWS_SEH}")
Expand Down
3 changes: 0 additions & 3 deletions cppcheckpremium-suppressions
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ premium-cert-str34-c
# we intentionally pass structs
premium-cert-dcl39-c-*

# we need to declare reserved identifier _CRTDBG_MAP_ALLOC
premium-cert-dcl51-cpp

# we don't want to check the return values of fclose/sprintf/etc
premium-cert-err33-c

Expand Down
4 changes: 0 additions & 4 deletions gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ CheckOptions:
if(WITH_QCHART)
target_link_libraries(cppcheck-gui ${QT_CHARTS_LIB})
endif()
if(MSVC)
# compilation will fail as e.g. QList::realloc would be replaced by MSVC's macro definition
target_compile_definitions(cppcheck-gui PRIVATE $<$<CONFIG:Debug>:DISABLE_CRTDBG_MAP_ALLOC>)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(QT_VERSION VERSION_LESS "6.4.0")
# caused by Qt generated moc code - see https://bugreports.qt.io/browse/QTBUG-100915
Expand Down
6 changes: 0 additions & 6 deletions lib/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@
# define CPPCHECKLIB
#endif

// MS Visual C++ memory leak debug tracing
#if !defined(DISABLE_CRTDBG_MAP_ALLOC) && defined(_MSC_VER) && defined(_DEBUG)
# define _CRTDBG_MAP_ALLOC
# include <crtdbg.h>
#endif

// compatibility macros
#ifndef __has_builtin
#define __has_builtin(x) 0
Expand Down
1 change: 1 addition & 0 deletions releasenotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ GUI:
-

Changed interface:
- removed CMake option "DISABLE_CRTDBG_MAP_ALLOC"
-

Infrastructure & dependencies:
Expand Down
5 changes: 0 additions & 5 deletions test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@

int main(int argc, char *argv[])
{
// MS Visual C++ memory leak debug tracing
#if defined(_MSC_VER) && defined(_DEBUG)
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
#endif

Preprocessor::macroChar = '$'; // While macroChar is char(1) per default outside test suite, we require it to be a human-readable character here.
gDisableColors = true;

Expand Down
Loading