From 45a6742e3f11a5fdfbdc62d6aebf965f824cbbbd Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Tue, 27 Jul 2010 17:34:13 +0300 Subject: [PATCH] Windows: Add _CRT_SECURE_NO_WARNINGS define. The _CRT_SECURE_NO_WARNINGS define suppresses some Windows-specific compile warnings. Windows has "secure" versions of some functions and compiler outputs warnings that those "secure" versions should be used instead. Since other platforms don't have those functions we just suppress this warning for now on. --- cli/cppcheck.vcproj | 4 ++-- cli/cppcheck.vcxproj | 4 ++-- gui/gui.pro | 1 + lib/lib.vcproj | 4 ++-- lib/lib.vcxproj | 4 ++-- test/test.vcproj | 4 ++-- test/test.vcxproj | 4 ++-- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/cli/cppcheck.vcproj b/cli/cppcheck.vcproj index f096c487e..a3b8c656d 100755 --- a/cli/cppcheck.vcproj +++ b/cli/cppcheck.vcproj @@ -47,7 +47,7 @@ Optimization="0" WholeProgramOptimization="false" AdditionalIncludeDirectories="..\lib" - PreprocessorDefinitions="_DEBUG;WIN32" + PreprocessorDefinitions="_DEBUG;WIN32;_CRT_SECURE_NO_WARNINGS" BasicRuntimeChecks="3" RuntimeLibrary="3" TreatWChar_tAsBuiltInType="false" @@ -131,7 +131,7 @@ EnableIntrinsicFunctions="true" WholeProgramOptimization="true" AdditionalIncludeDirectories="..\lib" - PreprocessorDefinitions="NDEBUG,WIN32" + PreprocessorDefinitions="NDEBUG,WIN32;_CRT_SECURE_NO_WARNINGS" RuntimeLibrary="2" TreatWChar_tAsBuiltInType="false" AssemblerListingLocation="$(IntDir)\" diff --git a/cli/cppcheck.vcxproj b/cli/cppcheck.vcxproj index 233059fca..0a41f0ecc 100644 --- a/cli/cppcheck.vcxproj +++ b/cli/cppcheck.vcxproj @@ -60,7 +60,7 @@ Disabled false ..\lib;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;%(PreprocessorDefinitions) + _DEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL false @@ -97,7 +97,7 @@ true true ..\lib;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;%(PreprocessorDefinitions) + NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL false $(IntDir) diff --git a/gui/gui.pro b/gui/gui.pro index e4215cfe1..42572b4cf 100644 --- a/gui/gui.pro +++ b/gui/gui.pro @@ -88,6 +88,7 @@ SOURCES += main.cpp \ logview.cpp win32 { + DEFINES += _CRT_SECURE_NO_WARNINGS RC_FILE = cppcheck-gui.rc HEADERS += ../cli/resource.h LIBS += -lshlwapi -lhtmlhelp diff --git a/lib/lib.vcproj b/lib/lib.vcproj index e8eaa2fa9..542ad7fff 100644 --- a/lib/lib.vcproj +++ b/lib/lib.vcproj @@ -41,7 +41,7 @@ Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL false @@ -69,7 +69,7 @@ MaxSpeed true true - NDEBUG;WIN32;_LIB;%(PreprocessorDefinitions) + NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL false $(IntDir) diff --git a/test/test.vcproj b/test/test.vcproj index 88f21a8d6..4e58c4e1b 100755 --- a/test/test.vcproj +++ b/test/test.vcproj @@ -45,7 +45,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\lib" - PreprocessorDefinitions="_DEBUG,WIN32,UNIT_TESTING" + PreprocessorDefinitions="_DEBUG,WIN32,UNIT_TESTING;_CRT_SECURE_NO_WARNINGS" BasicRuntimeChecks="3" RuntimeLibrary="3" TreatWChar_tAsBuiltInType="false" @@ -129,7 +129,7 @@ EnableIntrinsicFunctions="true" WholeProgramOptimization="true" AdditionalIncludeDirectories="..\lib" - PreprocessorDefinitions="NDEBUG,WIN32,UNIT_TESTING" + PreprocessorDefinitions="NDEBUG,WIN32,UNIT_TESTING;_CRT_SECURE_NO_WARNINGS" RuntimeLibrary="2" TreatWChar_tAsBuiltInType="false" AssemblerListingLocation="$(IntDir)\" diff --git a/test/test.vcxproj b/test/test.vcxproj index 01a890977..9b5a95775 100644 --- a/test/test.vcxproj +++ b/test/test.vcxproj @@ -58,7 +58,7 @@ Disabled ..\lib;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;UNIT_TESTING;%(PreprocessorDefinitions) + _DEBUG;WIN32;UNIT_TESTING;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL false @@ -95,7 +95,7 @@ true true ..\lib;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;UNIT_TESTING;%(PreprocessorDefinitions) + NDEBUG;WIN32;UNIT_TESTING;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL false $(IntDir)