From a7cae51cf75b263c393d8942fe68e8d77ace735c Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sun, 5 May 2024 08:53:25 +0200 Subject: [PATCH] Cleanup: quite gcc array-bounds warning This warning is known to produce false-positives unfortunately. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456 --- source/blender/blenlib/BLI_task_size_hints.hh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/blender/blenlib/BLI_task_size_hints.hh b/source/blender/blenlib/BLI_task_size_hints.hh index e9772b4914d..68ee63d1faf 100644 --- a/source/blender/blenlib/BLI_task_size_hints.hh +++ b/source/blender/blenlib/BLI_task_size_hints.hh @@ -112,6 +112,10 @@ inline bool use_single_thread(const TaskSizeHints &size_hints, const IndexRange range, const int64_t threshold) { +#ifdef __GNUC__ /* False positive warning with GCC. */ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Warray-bounds" +#endif switch (size_hints.type) { case TaskSizeHints::Type::Static: { const int64_t size = static_cast(size_hints).size; @@ -134,6 +138,9 @@ inline bool use_single_thread(const TaskSizeHints &size_hints, return accumulated_size <= threshold; } } +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif BLI_assert_unreachable(); return true; }