From 66738c12a173fe8bb3800a4b7cdc2634f4fd3dd8 Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Mon, 10 Nov 2025 20:30:27 +0100 Subject: [PATCH] Suppress false positive in cppcheck ``` source/simulation2/components/CCmpRangeManager.cpp:1953:18: error: Out of bounds access in 'm_LosRevealAll[MAX_LOS_PLAYER_ID+1]', if 'm_LosRevealAll' size is 16 and 'MAX_LOS_PLAYER_ID+1' is 17 [containerOutOfBounds] m_LosRevealAll[MAX_LOS_PLAYER_ID+1] = enabled; ^ source/simulation2/components/CCmpRangeManager.cpp:1967:21: error: Out of bounds access in 'm_LosRevealAll[MAX_LOS_PLAYER_ID+1]', if 'm_LosRevealAll' size is 16 and 'MAX_LOS_PLAYER_ID+1' is 17 [containerOutOfBounds] if (m_LosRevealAll[MAX_LOS_PLAYER_ID+1] || player == -1) ^ ``` Signed-off-by: Ralph Sennhauser --- source/tools/lint/cppcheck/suppressions-list.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/tools/lint/cppcheck/suppressions-list.txt b/source/tools/lint/cppcheck/suppressions-list.txt index 12aa1f109e..85e89fd4f6 100644 --- a/source/tools/lint/cppcheck/suppressions-list.txt +++ b/source/tools/lint/cppcheck/suppressions-list.txt @@ -17,6 +17,9 @@ unknownMacro:source/simulation2/TypeList.h // Issues reported by cppcheck and not yet fixed +// false positive +containerOutOfBounds:source/simulation2/components/CCmpRangeManager.cpp + danglingLifetime:source/lib/sysdep/os/unix/ufilesystem.cpp danglingTemporaryLifetime:source/graphics/TerrainTextureManager.cpp