Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove /Wall from MSVC #598

Merged
merged 75 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
c66a902
consistent settings in VS2022
Apr 4, 2022
d2adcfd
fix some errors when compiling C as C++
Apr 5, 2022
ccbd7ed
compile more C code as C++ for better type-checking
Apr 5, 2022
51297f5
fix a noexcept warning
Apr 6, 2022
39347ef
fix some compiler warnings
Apr 6, 2022
412b905
Merge branch 'master' into develop/remove-compiler-warnings
Apr 11, 2022
854942d
Merge branch 'master' into develop/remove-compiler-warnings
Apr 11, 2022
e5e704c
tweaks to build NITRO modules as DLLs/share-libraries (not actually e…
Apr 11, 2022
3711a6e
Merge branch 'master' into develop/remove-compiler-warnings
Apr 11, 2022
327aec7
tweak exports.hpp for DLL and LIB
Apr 11, 2022
e8c736e
Squashed commit of the following:
Apr 19, 2022
4ef023e
fix two code-analysis diagnostics
Apr 19, 2022
985f86b
Merge branch 'master' into develop/remove-compiler-warnings
Jul 20, 2022
9796edf
a few casts to "void*" to make the C++ compiler happy when compiling …
Jul 20, 2022
7d5fd83
turn off "unscoped enum" warning for coda-oss
Jul 20, 2022
8ee9b96
Squashed commit of the following:
Jul 29, 2022
204dbc4
Squashed commit of the following:
Aug 2, 2022
5883fcd
remove merge error
Aug 2, 2022
2f2a675
Merge branch 'master' into develop/remove-compiler-warnings
Aug 2, 2022
ba8eebd
Merge branch 'main' into develop/remove-compiler-warnings
Jan 23, 2023
0fab734
don't need both "override" and "final"
Jan 23, 2023
82229c1
Merge branch 'main' into develop/remove-compiler-warnings
Feb 8, 2023
17e3da4
reduce compiler warnings
Feb 8, 2023
1f69fc3
turn on GCC compiler warnings
Feb 8, 2023
6614c5a
build cleaning in CMake on Windows
Feb 8, 2023
0eea1ad
remove more warnings when building with CMake
Feb 8, 2023
2f92f4b
latest from coda-oss
Feb 8, 2023
0e2d2dd
latest from coda-oss
Feb 8, 2023
df5acc8
latest from coda-oss
Feb 9, 2023
d3fdd15
turn off warnings for code we don't control
Feb 9, 2023
7baccbc
turn off 'misleading indentation' for our C code
Feb 9, 2023
c966d4d
build NITRO cleanly (almost) on Windows
Feb 9, 2023
1a10691
turn off 'maybe uninitialized' for our C code
Feb 9, 2023
907a87b
latest from coda-oss
Feb 9, 2023
b59a335
latest from coda-oss
Feb 9, 2023
7009f7b
set the target language for specific directories
Feb 9, 2023
2550a1a
/W0 for directories we don't control
Feb 9, 2023
602606f
latest from coda-oss
Feb 9, 2023
e29e2fd
latest from coda-oss
Feb 9, 2023
c02ee14
fix Windows compile warnings
Feb 9, 2023
a45614a
does -j work for Windows builds?
Feb 9, 2023
651cc1d
fix the last Windows build error?
Feb 9, 2023
9c7f676
Merge branch 'main' into develop/remove-compiler-warnings
Feb 9, 2023
dff024f
add multi-processor compile for MSVC
Feb 9, 2023
a34ab25
Merge branch 'main' into develop/remove-compiler-warnings
Mar 8, 2023
81db3bf
ASAN needs a link option too
Mar 8, 2023
1371aa9
free allocated objects
Mar 8, 2023
d302617
remove a few compiler warnings from unittests
Mar 9, 2023
66bfc4a
Merge branch 'main' into develop/remove-compiler-warnings
Jun 13, 2023
17b5a67
Update test_j2k_loading++.cpp
Jun 13, 2023
0a21af7
Merge branch 'main' into develop/remove-compiler-warnings
Jul 5, 2023
52ad5e1
latest from CODA-OSS
Jul 5, 2023
9a3d56f
UNREFERENCED_PARAMETER(envVar);
Jul 5, 2023
217ecdb
use new "PlatformToolset" special environment variable
Jul 5, 2023
8584213
Squashed commit of the following:
Jul 5, 2023
066e3fd
Merge branch 'main' into develop/remove-compiler-warnings
Jul 5, 2023
1b3c0ca
Merge branch 'main' into develop/remove-compiler-warnings
Jul 12, 2023
ebf8c56
compile NITF-C as C++ in Visual Studio for better diagnostics
Jul 12, 2023
a9de277
remove some `#pragma`s from the PCH as they're no longer needed
Jul 12, 2023
44fd92f
simplify #includes/#pragmas
Jul 12, 2023
c3e012b
develop/sync_externals
Jul 12, 2023
bce8608
Merge branch 'main' into develop/remove-compiler-warnings
JDanielSmith Jul 18, 2023
e8cac67
Merge branch 'main' into develop/remove-compiler-warnings
Jul 18, 2023
862238e
Merge branch 'main' into develop/remove-compiler-warnings
Sep 14, 2023
67db393
ASAN tweaks from CODA-OSS
Sep 14, 2023
9fe4dc3
ASAN seems to be OK for Linux
Sep 14, 2023
f9198bd
call "destructors"
Sep 14, 2023
8123a29
Revert "ASAN seems to be OK for Linux"
Oct 2, 2023
5f48807
Merge branch 'main' into develop/remove-compiler-warnings
Nov 7, 2023
4792cb5
use Context overload to reduce use of .str()
Nov 7, 2023
8ed8ba8
Merge branch 'main' into develop/remove-compiler-warnings
Nov 8, 2023
bcc5f9e
Merge branch 'main' into develop/remove-compiler-warnings
Nov 13, 2023
d1e1405
Merge branch 'main' into develop/remove-compiler-warnings
Nov 15, 2023
93670e7
latest from CODA-OSS
Nov 15, 2023
004bef9
remove /Wall from MSVC
Nov 15, 2023
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
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
7 changes: 5 additions & 2 deletions externals/coda-oss/modules/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ set(TARGET_LANGUAGE c++)
if (MSVC)
# By default, there is a /W3 on the command-line from somewhere (?); adding
# /Wn results in a compiler warning.
#add_compile_options(/W4) # /Wall
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # /Wall
#
# 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)
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Expand Down
4 changes: 2 additions & 2 deletions externals/coda-oss/modules/c++/coda-oss.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>EnableAllWarnings</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions);CODA_OSS_EXPORTS;CODA_OSS_DLL;MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1</PreprocessorDefinitions>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
Expand Down Expand Up @@ -593,7 +593,6 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
Expand All @@ -609,6 +608,7 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>
Expand Down
3 changes: 2 additions & 1 deletion externals/coda-oss/modules/c++/str/include/str/Convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ std::string toString_(const T& value)
return buf.str();
}
template <typename T>
inline auto toString(const T& value)
inline std::string toString(const T& value)
{
return toString_(value);
}
Expand Down Expand Up @@ -105,6 +105,7 @@ inline auto toString(long double value)
{
return toString_(value);
}

inline std::string toString(uint8_t value)
{
return toString(gsl::narrow<unsigned int>(value));
Expand Down
21 changes: 7 additions & 14 deletions externals/coda-oss/modules/c++/str/source/Convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,25 @@ template<> std::string str::toType<std::string>(const std::string& s)

template<> bool str::toType<bool>(const std::string& s)
{
std::string ss = s;
str::lower(ss);

if (ss == "true")
if (eq(s, "true")) // case-insensitive compare
{
return true;
}
else if (ss == "false")
if (eq(s, "false")) // case-insensitive compare
{
return false;
}
else if (str::isNumeric(ss))

// no need for lower(), digits don't have case
if (str::isNumeric(s))
{
int value(0);
std::stringstream buf(ss);
std::stringstream buf(s);
buf >> value;
return (value != 0);
}
else
{
throw except::BadCastException(except::Context(__FILE__, __LINE__,
std::string(""), std::string(""),
std::string("Invalid bool: '") + s + std::string("'")));
}

return false;
throw except::BadCastException(except::Context(__FILE__, __LINE__, "", "", "Invalid bool: '" + s + "'"));
}

long long str::strtoll(const char *str, char **endptr, int base)
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
Loading