blob: a935dc2165c6ca74deb6462b2ca1eada7f600926 [file] [log] [blame]
//-------------------------------------------------------------------------------
// Copyright (c) 2018-2025, Arm Limited and Contributors. All rights reserved.
//
// SPDX-License-Identifier: BSD-3-Clause
//
//-------------------------------------------------------------------------------
//This file contains suppression rules for CppCheck.
//C style comments can be used.
//
//Each line has three parts separated by ":"
//<message id>:<file>:<line num>
//Where:
// <message id> is the message id to suppress. This equals to the "id" filed
// of the XML message record.
// <file> Is a file name. cppcheck understands the following wildcards:
// * matches any number of any characters
// ? a single character
// Note: please use '/' as directory separator.
// <line num> The line number for which the message shall be ignored.
//
//Example to convert an XML record to a line in thif file:
// <error id="invalidPrintfArgType_sint" severity="warning" msg="%d in format string (no. 1) requires &apos;int&apos; but the argument type is &apos;unsigned int&apos;." verbose="%d in format string (no. 1) requires &apos;int&apos; but the argument type is &apos;unsigned int&apos;." cwe="686">
// <location file0="C:\work\tf-m\test\framework\test_framework.c" file="C:\work\tf-m\test\framework\test_framework.c" line="150"/>
// </error>
// to
//invalidPrintfArgType_sint:*/tf-m/test/framework/test_framework.c:150
//
//This rule conflicts the our coding style document.
variableScope
//While cppcheck states to work fine with missing standard library files, it
//still reports a lot of errors regarding those.
//So, ignore these.
missingIncludeSystem
//Stos cppcheck report errors regarding supression rules. These seem to be
//buggy.
unmatchedSuppression
//arm_cmse.h is a special system include, stop complaining about it.
missingInclude:*/tfm_core.h:11
missingInclude:*/tfm_secure_api.h:11
//Exclude external code which does not need to comply with guidelines
*:*/lib/ext/*
*:*/docs/*
*:*/tools/*
*:*/bl2/ext/*
*:*/platform/ext/accelerator/*
*:*/platform/ext/driver/*
*:*/platform/ext/target/*
*:*/mcuboot/*
*:*/mbedtls/*
*:lib/ext/qcbor-src/*
*:lib/ext/t_cose-src/*
*:lib/ext/cmsis-src/*
//cppcheck shouldn't complain about unused function.
unusedFunction
//Variables in the following file are initialised to a specific value before being
//modified. This is good practice and complies with TF-M guidelines. It should not
//trigger an error.
redundantInitialization:*/security_cnt.c