]> OCCT Git - occt.git/commitdiff
0032919: Coding Rules - suppress useless MSVC warning C26812 on VS2019/C++20 (prefer...
authorddzama <ddzama@opencascade.com>
Thu, 31 Mar 2022 13:18:19 +0000 (16:18 +0300)
committersmoskvin <smoskvin@opencascade.com>
Wed, 4 May 2022 18:11:11 +0000 (21:11 +0300)
CMake and genproj scripts have been updated to suppress this misleading warning that cannot be fixed without breaking existing API.

adm/cmake/occt_defs_flags.cmake
adm/templates/template.vc10
adm/templates/template.vc10x

index d1c8172bdd88c894f5d4eb84c482f6583bf424d2..dc20cc283b6f68ba6500bd6a8b5905409e06f1af 100644 (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")
index 158733423c9b84a66911c23fa123bc548bad4e1b..282b75f90a803c707d613cf07ff92c40a1c20748 100644 (file)
       <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__
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>26812</DisableSpecificWarnings>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <FloatingPointModel>Precise</FloatingPointModel>
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <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__
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>26812</DisableSpecificWarnings>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <FloatingPointModel>Precise</FloatingPointModel>
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
index 07f9c750fed57e21af27bd5969563664a266682e..843376b2cde96c6981e67bfea937caf4110c8bdc 100644 (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>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>26812</DisableSpecificWarnings>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
     </ClCompile>
       <ProgramDataBaseFileName>.\..\..\..\win64\__VCVER__\obj\__XQTNAM__/</ProgramDataBaseFileName>
       <WarningLevel>Level4</WarningLevel>
       <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>26812</DisableSpecificWarnings>
       <FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
     </ClCompile>
     <ResourceCompile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>26812</DisableSpecificWarnings>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
     </ClCompile>