Skip to content

Commit 38a467d

Browse files
Add cross-linking comments to tests referencing other rules.
1 parent 794e97a commit 38a467d

File tree

8 files changed

+37
-17
lines changed

8 files changed

+37
-17
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
| test.c:8:15:8:20 | call to malloc | Use of banned dynamic memory allocation. |
2-
| test.c:9:15:9:20 | call to calloc | Use of banned dynamic memory allocation. |
3-
| test.c:10:8:10:14 | call to realloc | Use of banned dynamic memory allocation. |
4-
| test.c:11:3:11:6 | call to free | Use of banned dynamic memory deallocation. |
5-
| test.c:12:3:12:6 | call to free | Use of banned dynamic memory deallocation. |
1+
| test.c:13:15:13:20 | call to malloc | Use of banned dynamic memory allocation. |
2+
| test.c:14:15:14:20 | call to calloc | Use of banned dynamic memory allocation. |
3+
| test.c:15:8:15:14 | call to realloc | Use of banned dynamic memory allocation. |
4+
| test.c:16:3:16:6 | call to free | Use of banned dynamic memory deallocation. |
5+
| test.c:17:3:17:6 | call to free | Use of banned dynamic memory deallocation. |

c/misra/test/rules/RULE-21-3/test.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Note: A subset of these cases are also tested in c/misra/test/rules/RULE-1-5
2+
// via a MemoryAllocDeallocFunctionsOfStdlibhUsed.qlref and .expected file in
3+
// that directory. Changes to these tests may require updating the test code or
4+
// expectations in that directory as well.
5+
16
#include <stdio.h>
27
#include <stdlib.h>
38
void f2();
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
| test.c:8:10:8:14 | call to scanf | Call to banned function scanf. |
2-
| test.c:9:5:9:10 | call to printf | Call to banned function printf. |
3-
| test.c:16:16:16:21 | call to fgetwc | Call to banned function fgetwc. |
4-
| test.c:17:5:17:12 | call to putwchar | Call to banned function putwchar. |
5-
| test.c:22:7:22:10 | call to puts | Call to banned function puts. |
6-
| test.c:24:7:24:10 | call to puts | Call to banned function puts. |
7-
| test.c:26:5:26:8 | call to puts | Call to banned function puts. |
1+
| test.c:13:10:13:14 | call to scanf | Call to banned function scanf. |
2+
| test.c:14:5:14:10 | call to printf | Call to banned function printf. |
3+
| test.c:21:16:21:21 | call to fgetwc | Call to banned function fgetwc. |
4+
| test.c:22:5:22:12 | call to putwchar | Call to banned function putwchar. |
5+
| test.c:27:7:27:10 | call to puts | Call to banned function puts. |
6+
| test.c:29:7:29:10 | call to puts | Call to banned function puts. |
7+
| test.c:31:5:31:8 | call to puts | Call to banned function puts. |

c/misra/test/rules/RULE-21-6/test.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Note: A subset of these cases are also tested in c/misra/test/rules/RULE-1-5
2+
// via a StandardLibraryInputoutputFunctionsUsed.qlref and .expected file in
3+
// that directory. Changes to these tests may require updating the test code or
4+
// expectations in that directory as well.
5+
16
#include <errno.h>
27
#include <locale.h>
38
#include <stdio.h>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| test.c:3:6:3:7 | f1 | Function f1 declares parameter that is unnamed. |
2-
| test.c:4:6:4:7 | f2 | Function f2 does not specify void for no parameters present. |
3-
| test.c:5:6:5:7 | f3 | Function f3 does not specify void for no parameters present. |
4-
| test.c:7:5:7:6 | f5 | Function f5 declares parameter in unsupported declaration list. |
1+
| test.c:8:6:8:7 | f1 | Function f1 declares parameter that is unnamed. |
2+
| test.c:9:6:9:7 | f2 | Function f2 does not specify void for no parameters present. |
3+
| test.c:10:6:10:7 | f3 | Function f3 does not specify void for no parameters present. |
4+
| test.c:12:5:12:6 | f5 | Function f5 declares parameter in unsupported declaration list. |

c/misra/test/rules/RULE-8-2/test.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Note: A subset of these cases are also tested in c/misra/test/rules/RULE-1-5
2+
// via a FunctionTypesNotInPrototypeForm.qlref and .expected file in that
3+
// directory. Changes to these tests may require updating the test code or
4+
// expectations in that directory as well.
5+
16
void f(int x); // COMPLIANT
27
void f0(void); // COMPLIANT
38
void f1(int); // NON_COMPLIANT
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| test.c:2:12:2:12 | declaration of g | The redeclaration of $@ with internal linkage misses the static specifier. | test.c:1:12:1:12 | definition of g | g |
1+
| test.c:7:12:7:12 | declaration of g | The redeclaration of $@ with internal linkage misses the static specifier. | test.c:6:12:6:12 | definition of g | g |

c/misra/test/rules/RULE-8-8/test.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Note: A subset of these cases are also tested in c/misra/test/rules/RULE-1-5
2+
// via a MissingStaticSpecifierObjectRedeclarationC.qlref and .expected file in
3+
// that directory. Changes to these tests may require updating the test code or
4+
// expectations in that directory as well.
5+
16
static int g = 0;
27
extern int g; // NON_COMPLIANT
38

0 commit comments

Comments
 (0)