1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0032919: Coding Rules - suppress useless MSVC warning C26812 on VS2019/C++20 (prefer 'enum class' over 'enum')

CMake and genproj scripts have been updated to suppress this misleading warning that cannot be fixed without breaking existing API.
This commit is contained in:
ddzama 2022-03-31 16:18:19 +03:00 committed by smoskvin
parent 5dd4cb6e60
commit 1966e6af07
3 changed files with 11 additions and 8 deletions

View File

@ -25,6 +25,9 @@ if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
endif()
if (MSVC)
# suppress C26812 on VS2019/C++20 (prefer 'enum class' over 'enum')
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd\"26812\"")
# suppress warning on using portable non-secure functions in favor of non-portable secure ones
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fPIC")

View File

@ -100,7 +100,7 @@
<ProgramDataBaseFileName>.\..\..\..\win32\__VCVER__\obj\__TKNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
__VCMPL32__
@ -148,7 +148,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
@ -196,7 +196,7 @@
<ProgramDataBaseFileName>.\..\..\..\win64\__VCVER__\obj\__TKNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
__VCMPL64__
@ -244,7 +244,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>

View File

@ -95,7 +95,7 @@
<ProgramDataBaseFileName>.\..\..\..\win32\__VCVER__\obj\__XQTNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
</ClCompile>
<ResourceCompile>
@ -140,7 +140,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
</ClCompile>
@ -185,7 +185,7 @@
<ProgramDataBaseFileName>.\..\..\..\win64\__VCVER__\obj\__XQTNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
</ClCompile>
<ResourceCompile>
@ -229,7 +229,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
</ClCompile>