| //------------------------------------------------------------------------------- |
| // Copyright (c) 2018-2024, 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 'int' but the argument type is 'unsigned int'." verbose="%d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'." 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/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 |