File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -654,7 +654,21 @@ Or at the same line as the code:
654654 arr[10] = 0; // cppcheck-suppress arrayIndexOutOfBounds
655655 }
656656
657- In this example there are 2 lines with code and 1 suppression comment. The suppression comment only applies to 1 line: ` a = b + c; ` .
657+ The suppression comment and the line of code may be separated by additional comments or empty lines:
658+
659+ void f() {
660+ char arr[5];
661+
662+ // cppcheck-suppress arrayIndexOutOfBounds
663+
664+ arr[10] = 0;
665+
666+ // cppcheck-suppress arrayIndexOutOfBounds
667+ // Set the tenth element of arr to zero
668+ arr[10] = 0;
669+ }
670+
671+ In the example below there are 2 lines with code and 1 suppression comment. The suppression comment only applies to 1 line: ` a = b + c; ` .
658672
659673 void f() {
660674 a = b + c; // cppcheck-suppress abc
You can’t perform that action at this time.
0 commit comments