Amend 84545db disabling more MSVC zealous debug checks
(data point: in a debug build of the test app, going from pre 84545db to this, some our large test goes from 4.0 to 2.0 ms)
diff --git a/imgui.cpp b/imgui.cpp
index ebbf76e..324301a 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -820,6 +820,7 @@
#pragma warning (disable: 26495) // [Static Analyzer] Variable 'XXX' is uninitialized. Always initialize a member variable (type.6).
#pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
#endif
+IM_MSVC_RUNTIME_CHECKS_OFF
// Clang/GCC warnings with -Weverything
#if defined(__clang__)
@@ -11558,6 +11559,8 @@
#endif
+IM_MSVC_RUNTIME_CHECKS_RESTORE
+
//-----------------------------------------------------------------------------
// Include imgui_user.inl at the end of imgui.cpp to access private data/functions that aren't exposed.
diff --git a/imgui.h b/imgui.h
index 31de2a9..163b886 100644
--- a/imgui.h
+++ b/imgui.h
@@ -126,6 +126,8 @@
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
#endif
+IM_MSVC_RUNTIME_CHECKS_OFF
+
//-----------------------------------------------------------------------------
// [SECTION] Forward declarations and basic types
//-----------------------------------------------------------------------------
@@ -240,7 +242,6 @@
#endif
// 2D vector (often used to store positions or sizes)
-IM_MSVC_RUNTIME_CHECKS_OFF
struct ImVec2
{
float x, y;
diff --git a/imgui_demo.cpp b/imgui_demo.cpp
index 050a5ab..a001be8 100644
--- a/imgui_demo.cpp
+++ b/imgui_demo.cpp
@@ -94,6 +94,7 @@
#ifdef _MSC_VER
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
+IM_MSVC_RUNTIME_CHECKS_OFF
#endif
// Clang/GCC warnings with -Weverything
@@ -7701,4 +7702,6 @@
#endif
+IM_MSVC_RUNTIME_CHECKS_RESTORE
+
#endif // #ifndef IMGUI_DISABLE
diff --git a/imgui_draw.cpp b/imgui_draw.cpp
index d8c3b5f..91a38b7 100644
--- a/imgui_draw.cpp
+++ b/imgui_draw.cpp
@@ -60,6 +60,7 @@
#pragma warning (disable: 6255) // [Static Analyzer] _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead.
#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
#pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). [MSVC Static Analyzer)
+IM_MSVC_RUNTIME_CHECKS_OFF
#endif
// Clang/GCC warnings with -Weverything
@@ -4149,4 +4150,6 @@
return proggy_clean_ttf_compressed_data_base85;
}
+IM_MSVC_RUNTIME_CHECKS_RESTORE
+
#endif // #ifndef IMGUI_DISABLE
diff --git a/imgui_internal.h b/imgui_internal.h
index 088f8f8..f4fcb50 100644
--- a/imgui_internal.h
+++ b/imgui_internal.h
@@ -57,7 +57,7 @@
#pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport)
#pragma warning (disable: 26812) // The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). [MSVC Static Analyzer)
#pragma warning (disable: 26495) // [Static Analyzer] Variable 'XXX' is uninitialized. Always initialize a member variable (type.6).
-
+IM_MSVC_RUNTIME_CHECKS_OFF
#endif
// Clang/GCC warnings with -Weverything
@@ -2653,6 +2653,7 @@
#endif
#ifdef _MSC_VER
+IM_MSVC_RUNTIME_CHECKS_RESTORE
#pragma warning (pop)
#endif
diff --git a/imgui_tables.cpp b/imgui_tables.cpp
index 62458ab..df6e0ce 100644
--- a/imgui_tables.cpp
+++ b/imgui_tables.cpp
@@ -213,6 +213,7 @@
#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
#pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
#endif
+IM_MSVC_RUNTIME_CHECKS_OFF
// Clang/GCC warnings with -Weverything
#if defined(__clang__)
@@ -4001,4 +4002,6 @@
//-------------------------------------------------------------------------
+IM_MSVC_RUNTIME_CHECKS_RESTORE
+
#endif // #ifndef IMGUI_DISABLE
diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp
index f72537c..1d3a88b 100644
--- a/imgui_widgets.cpp
+++ b/imgui_widgets.cpp
@@ -62,6 +62,7 @@
#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
#pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
#endif
+IM_MSVC_RUNTIME_CHECKS_OFF
// Clang/GCC warnings with -Weverything
#if defined(__clang__)
@@ -8049,5 +8050,6 @@
*out_just_closed = close_button_pressed;
}
+IM_MSVC_RUNTIME_CHECKS_RESTORE
#endif // #ifndef IMGUI_DISABLE