From cd5ef3fc2732ea1a452c93f86b5aff6e68368770 Mon Sep 17 00:00:00 2001 From: Wei-Chia Su Date: Wed, 5 Jun 2024 14:30:09 +0100 Subject: [PATCH] cppcheck: Update guide, wrapper and suppression list This patch updates document/script to cppcheck V2.8 and bypass error ids with unknown macro before switching to V2.8 which is also compatible with V1.90. Signed-off-by: Wei-Chia Su --- docker/Dockerfile | 2 +- tools/cppcheck_suppress_list.txt | 9 +++++++++ tools/cppcheck_wrapper.py | 4 ++-- user_guide.md | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8387dd7d0..4274ca243 100755 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -11,7 +11,7 @@ ARG ARM_NONE_EABI_VERSION="10.3-2021.10" ARG AARCH64_NONE_ELF_VERSION="9.2-2019.12" ARG CMAKE_VERSION="3.25.2" ARG LLVM_VERSION="13" -ARG CPPCHECK_VERSION="1.90" +ARG CPPCHECK_VERSION="2.8" ARG DOXYGEN_VERSION="1.8.13" ENV DEBIAN_FRONTEND=noninteractive diff --git a/tools/cppcheck_suppress_list.txt b/tools/cppcheck_suppress_list.txt index 2ee3e3afb..75f9c4f42 100755 --- a/tools/cppcheck_suppress_list.txt +++ b/tools/cppcheck_suppress_list.txt @@ -153,3 +153,12 @@ syntaxError:*product/morello/module/dmc_bing/include/mod_dmc_bing.h:789 // Suppress CMSIS errors *:*/CMSIS*/* + +// Cppcheck seems to get confused with macro substitution +unknownMacro:*product/rcar/module/rcar_system/src/rcar_common.c:22 +unknownMacro:*product/rcar/module/rcar_system/src/rcar_iic_dvfs.c:173 +unknownMacro:*product/rcar/module/rcar_system/src/rcar_pwc.c:162 +unknownMacro:*product/morello/module/morello_system/src/mod_morello_system.c:302 +unknownEvaluationOrder:*framework/src/fwk_io.c:60 +unknownEvaluationOrder:*framework/src/fwk_io.c:61 +unknownEvaluationOrder:*framework/src/fwk_io.c:63 diff --git a/tools/cppcheck_wrapper.py b/tools/cppcheck_wrapper.py index a830a7667..76674206e 100755 --- a/tools/cppcheck_wrapper.py +++ b/tools/cppcheck_wrapper.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # # Arm SCP/MCP Software -# Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2021-2024, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -35,7 +35,7 @@ import re # Holds required version info. -required_tool_version = "1.90" +required_tool_version = "2.8" tool_name = "CPPCHECK" diff --git a/user_guide.md b/user_guide.md index 10dde0914..652e9b668 100644 --- a/user_guide.md +++ b/user_guide.md @@ -55,7 +55,7 @@ order to run the tests suites - [ARM GCC GNU-A toolchain] (*7.4.0* or later): Required to build framework tests that run on the host system - [lcov] (*1.13* or later): Required to run unit test framework -- [cppcheck] (*1.90*): Required during build process to check the code +- [cppcheck] (*2.8*): Required during build process to check the code - [ninja-build] (*1.10.0* or later): Default build system to compile the project UNIX-Make is a suitable alternative if preferred. - [clang-format] (*10.0.0* or later): Automatic code formatter.