From 085fa42b7df25cff3030a8c58547bb6c95d284f5 Mon Sep 17 00:00:00 2001 From: cfillion Date: Thu, 27 Apr 2023 19:15:48 +0200 Subject: [PATCH] Adedd workaround for GCC erroneous/zealous warning (#5343) --- imgui_draw.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 313bc0f3e..b76f876d2 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -2623,6 +2623,9 @@ void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opa ImVector& user_rects = atlas->CustomRects; IM_ASSERT(user_rects.Size >= 1); // We expect at least the default custom rects to be registered, else something went wrong. +#ifdef __GNUC__ + if (user_rects.Size < 1) { __builtin_unreachable(); } // Workaround for GCC bug if IM_ASSERT() is defined to conditionally throw (see #5343) +#endif ImVector pack_rects; pack_rects.resize(user_rects.Size);