cppcheck: Changes to enable scanning codebase without silent errors
Amend the library config file and the suppression list to be able
to scan the codebase as desired without silently failing due to
invalid configurations.
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
Change-Id: Ia4585283958a1579f4895553a83db6d338d9fad6
diff --git a/cppcheck/arm-cortex-m.cfg b/cppcheck/arm-cortex-m.cfg
index 5da59d6..05cb049 100644
--- a/cppcheck/arm-cortex-m.cfg
+++ b/cppcheck/arm-cortex-m.cfg
@@ -1,13 +1,27 @@
<?xml version="1.0"?>
<!--
#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2019, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-->
<def format="2">
+ <!-- Modules that might be using mbedtls based allocator functions -->
+ <resource>
+ <alloc>mbedtls_calloc</alloc>
+ <dealloc>mbedtls_free</dealloc>
+ </resource>
+ <!-- Missing platform defines on which some header preprocessing relies -->
+ <define name="CHAR_BIT" value="8"/>
+ <!-- This would be defined by the GNUARM toolchain -->
+ <define name="__GNUC__" value="1"/>
+ <!-- This would be defined by the GNUARM toolchain -->
+ <define name="__ARM_ARCH_8M_MAIN__" value="1"/>
+ <!-- tfm_core_panic() and psa_panic() interrupt the flow unconditionally -->
+ <function name="tfm_core_panic"> <noreturn>true</noreturn> </function>
+ <function name="psa_panic"> <noreturn>true</noreturn> </function>
<!-- Minimum-width integer types -->
<podtype name="int_least8_t" sign="s" size="1"/>
<podtype name="uint_least8_t" sign="u" size="1"/>