Skip to content

Commit 273ceb2

Browse files
committed
RULE-21-9: Simplify alert message, remove stdlib.h
1 parent 03e0340 commit 273ceb2

File tree

4 files changed

+4
-180
lines changed

4 files changed

+4
-180
lines changed

c/misra/src/rules/RULE-21-9/BsearchAndQsortOfStdlibhUsed.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ where
2121
f = fc.getTarget() and
2222
f.getName() = ["qsort", "bsearch"] and
2323
f.getFile().getBaseName() = "stdlib.h"
24-
select fc, "Call to banned function $@.", f, f.getName()
24+
select fc, "Call to banned function " + f.getName() + "."
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| test.c:22:3:22:7 | call to qsort | Call to banned function $@. | stdlib.h:56:6:56:10 | qsort | qsort |
2-
| test.c:26:9:26:15 | call to bsearch | Call to banned function $@. | stdlib.h:55:7:55:13 | bsearch | bsearch |
1+
| test.c:22:3:22:7 | call to qsort | Call to banned function qsort. |
2+
| test.c:26:9:26:15 | call to bsearch | Call to banned function bsearch. |

c/misra/test/rules/RULE-21-9/stdlib.h

Lines changed: 0 additions & 176 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "stdlib.h"
21
#include <stdio.h>
2+
#include <stdlib.h>
33
#include <string.h>
44
#define size_of_months (sizeof(months) / sizeof(months[0]))
55

0 commit comments

Comments
 (0)