Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 1 | //------------------------------------------------------------------------------- |
Gergely Korcsák | a1fa54e | 2024-02-12 22:07:39 +0100 | [diff] [blame] | 2 | // Copyright (c) 2018-2024, Arm Limited and Contributors. All rights reserved. |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 3 | // |
| 4 | // SPDX-License-Identifier: BSD-3-Clause |
| 5 | // |
| 6 | //------------------------------------------------------------------------------- |
| 7 | |
| 8 | //This file contains suppression rules for CppCheck. |
| 9 | //C style comments can be used. |
| 10 | // |
| 11 | //Each line has three parts separated by ":" |
| 12 | //<message id>:<file>:<line num> |
| 13 | //Where: |
| 14 | // <message id> is the message id to suppress. This equals to the "id" filed |
| 15 | // of the XML message record. |
| 16 | // <file> Is a file name. cppcheck understands the following wildcards: |
| 17 | // * matches any number of any characters |
| 18 | // ? a single character |
| 19 | // Note: please use '/' as directory separator. |
| 20 | // <line num> The line number for which the message shall be ignored. |
| 21 | // |
| 22 | //Example to convert an XML record to a line in thif file: |
| 23 | // <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"> |
| 24 | // <location file0="C:\work\tf-m\test\framework\test_framework.c" file="C:\work\tf-m\test\framework\test_framework.c" line="150"/> |
| 25 | // </error> |
| 26 | // to |
| 27 | //invalidPrintfArgType_sint:*/tf-m/test/framework/test_framework.c:150 |
| 28 | // |
| 29 | |
| 30 | //This rule conflicts the our coding style document. |
| 31 | variableScope |
| 32 | |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 33 | //While cppcheck states to work fine with missing standard library files, it |
| 34 | //still reports a lot of errors regarding those. |
| 35 | //So, ignore these. |
| 36 | missingIncludeSystem |
| 37 | |
| 38 | //Stos cppcheck report errors regarding supression rules. These seem to be |
| 39 | //buggy. |
| 40 | unmatchedSuppression |
| 41 | |
| 42 | //arm_cmse.h is a special system include, stop complaining about it. |
| 43 | missingInclude:*/tfm_core.h:11 |
| 44 | missingInclude:*/tfm_secure_api.h:11 |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 45 | |
Xinyu Zhang | 2dfef33 | 2022-10-27 19:05:56 +0800 | [diff] [blame] | 46 | //Exclude external code which does not need to comply with guidelines |
| 47 | *:*/lib/ext/* |
Xinyu Zhang | 726aaa5 | 2021-02-20 15:56:54 +0800 | [diff] [blame] | 48 | *:*/docs/* |
| 49 | *:*/tools/* |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 50 | *:*/bl2/ext/* |
chesun01 | 39f6637 | 2022-12-15 11:12:03 +0800 | [diff] [blame] | 51 | *:*/platform/ext/accelerator/* |
chesun01 | 39f6637 | 2022-12-15 11:12:03 +0800 | [diff] [blame] | 52 | *:*/platform/ext/driver/* |
| 53 | *:*/platform/ext/target/* |
Antonio de Angelis | b1c5fa2 | 2021-12-02 16:05:29 +0000 | [diff] [blame] | 54 | *:*/mcuboot/* |
| 55 | *:*/mbedtls/* |
Xinyu Zhang | 2dfef33 | 2022-10-27 19:05:56 +0800 | [diff] [blame] | 56 | *:lib/ext/qcbor-src/* |
Gergely Korcsák | a1fa54e | 2024-02-12 22:07:39 +0100 | [diff] [blame] | 57 | *:lib/ext/cmsis-src/* |
Hugo L'Hostis | fa96af2 | 2021-01-11 12:25:35 +0000 | [diff] [blame] | 58 | |
| 59 | //cppcheck shouldn't complain about unused function. |
| 60 | unusedFunction |
| 61 | |
| 62 | //Variables in the following file are initialised to a specific value before being |
| 63 | //modified. This is good practice and complies with TF-M guidelines. It should not |
| 64 | //trigger an error. |
| 65 | redundantInitialization:*/security_cnt.c |