Skip to content

Commit

Permalink
remove /Wall from MSVC
Browse files Browse the repository at this point in the history
https://github.com/microsoft/STL/wiki/Changelog#vs-2022-179-preview-1
> *Note*: `/Wall` is not intended for regular production use, as it contains a large number of
> extremely noisy and low-value warnings. In general, the STL does not attempt to be `/Wall` clean.
  • Loading branch information
Dan Smith committed Nov 15, 2023
1 parent 93670e7 commit 004bef9
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion UnitTest/UnitTest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)modules\c\nrt\include;$(SolutionDir)modules\c\nitf\include;$(SolutionDir)modules\c++\nitf\include;$(SolutionDir)modules\c\j2k\include;$(SolutionDir)modules\c;$(SolutionDir)modules\c++;$(SolutionDir)externals\coda-oss\modules\c++;$(SolutionDir)externals\coda-oss\out\install\$(Platform)-$(Configuration)\include;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
9 changes: 6 additions & 3 deletions modules/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ set(TARGET_LANGUAGE c++)
# turn on warnings as errors
if (MSVC)
# By default, there is a /W3 on the command-line from somewhere (?); adding
# /W4 results in a compiler warning.
#add_compile_options(/W4) # /Wall
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # /Wall
# /Wn results in a compiler warning.
#
# https://github.com/microsoft/STL/wiki/Changelog#vs-2022-179-preview-1
# > *Note*: `/Wall` is not intended for regular production use, as it contains a large number of
# > extremely noisy and low-value warnings. In general, the STL does not attempt to be `/Wall` clean.
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # add_compile_options(/W4)

elseif (UNIX)
#add_compile_options(-Wall -pedantic -Wextra)
Expand Down
3 changes: 2 additions & 1 deletion modules/c++/nitf-c++.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>EnableAllWarnings</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
Expand All @@ -233,6 +233,7 @@
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>
Expand Down
3 changes: 2 additions & 1 deletion modules/c++/nitf/apps/show_nitf++/show_nitf++.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>EnableAllWarnings</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
Expand All @@ -65,6 +65,7 @@
<SupportJustMyCode>true</SupportJustMyCode>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
2 changes: 1 addition & 1 deletion modules/c++/nitf/source/UnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ static std::string buildPluginName(const std::string& base)
void nitf::Test::setNitfPluginPath()
{
// The name of the plugin we know exists and will always be built, see test_load_plugins
static const auto p = getNitfPluginPath(buildPluginName("XML_DATA_CONTENT"));
static const auto p = getNitfPluginPath(buildPluginName("TEST_DES"));
sys::OS().setEnv("NITF_PLUGIN_PATH", p.string(), true /*overwrite*/);
}

Expand Down
2 changes: 1 addition & 1 deletion modules/c++/nitf/unittests/test_load_plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ TEST_CASE(test_load_ENGRDA)

TEST_CASE(test_load_all_TREs)
{
const nitf::TRE tre("ACCPOB");
const nitf::TRE ACCPOB("ACCPOB");

for (const auto& tre : all_TREs())
{
Expand Down
9 changes: 6 additions & 3 deletions modules/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ set(TARGET_LANGUAGE c)
# turn on warnings as errors
if (MSVC)
# By default, there is a /W3 on the command-line from somewhere (?); adding
# /W4 results in a compiler warning.
#add_compile_options(/W4) # /Wall
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") # /Wall
# /Wn results in a compiler warning.
#
# https://github.com/microsoft/STL/wiki/Changelog#vs-2022-179-preview-1
# > *Note*: `/Wall` is not intended for regular production use, as it contains a large number of
# > extremely noisy and low-value warnings. In general, the STL does not attempt to be `/Wall` clean.
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # add_compile_options(/W4)

add_compile_options(/wd4996) # '...': This function or variable may be unsafe.
elseif (UNIX)
Expand Down
2 changes: 1 addition & 1 deletion modules/c/j2k/J2KCompress.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>EnableAllWarnings</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions);NRT_MODULE_EXPORTS;NITRO_PCH;HAVE_J2K_H</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
Expand Down
2 changes: 1 addition & 1 deletion modules/c/j2k/J2KDecompress.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>EnableAllWarnings</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions);NRT_MODULE_EXPORTS;NITRO_PCH;HAVE_J2K_H</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
Expand Down
3 changes: 2 additions & 1 deletion modules/c/nitf-c.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>EnableAllWarnings</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions);HAVE_OPENJPEG_H</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
Expand All @@ -68,6 +68,7 @@
<ExceptionHandling>false</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>
Expand Down
2 changes: 1 addition & 1 deletion modules/c/nitf/TEST_DES.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>EnableAllWarnings</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions);NRT_MODULE_EXPORTS;NITRO_PCH</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
Expand Down
2 changes: 1 addition & 1 deletion modules/c/nitf/XML_DATA_CONTENT.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>EnableAllWarnings</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions);NRT_MODULE_EXPORTS;NITRO_PCH</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
Expand Down

0 comments on commit 004bef9

Please sign in to comment.