Skip to content

Commit ca78795

Browse files
committed
RULE-21-7: Simplify alert message, remove stdlib.h
1 parent c803680 commit ca78795

File tree

4 files changed

+6
-182
lines changed

4 files changed

+6
-182
lines changed

c/misra/src/rules/RULE-21-7/AtofAtoiAtolAndAtollOfStdlibhUsed.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ where
2222
f = fc.getTarget() and
2323
f.getName() = atoi() and
2424
f.getFile().getBaseName() = "stdlib.h"
25-
select fc, "Call to banned function $@.", f, f.getName()
25+
select fc, "Call to banned function " + f.getName() + "."
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| test.c:6:14:6:17 | call to atof | Call to banned function $@. | stdlib.h:24:8:24:11 | atof | atof |
2-
| test.c:7:12:7:15 | call to atoi | Call to banned function $@. | stdlib.h:21:5:21:8 | atoi | atoi |
3-
| test.c:8:13:8:16 | call to atol | Call to banned function $@. | stdlib.h:22:6:22:9 | atol | atol |
4-
| test.c:9:18:9:22 | call to atoll | Call to banned function $@. | stdlib.h:23:11:23:15 | atoll | atoll |
1+
| test.c:6:14:6:17 | call to atof | Call to banned function atof. |
2+
| test.c:7:12:7:15 | call to atoi | Call to banned function atoi. |
3+
| test.c:8:13:8:16 | call to atol | Call to banned function atol. |
4+
| test.c:9:18:9:22 | call to atoll | Call to banned function atoll. |

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

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

c/misra/test/rules/RULE-21-7/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 <float.h>
2+
#include <stdlib.h>
33
void f2();
44
void f1() {
55
char l1[5] = "abcde";

0 commit comments

Comments
 (0)