Skip to content

Commit efd7b79

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

File tree

6 files changed

+12
-188
lines changed

6 files changed

+12
-188
lines changed

c/misra/src/rules/RULE-21-8/TerminationFunctionsOfStdlibhUsed.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ from FunctionCall fc, BannedFunction f
2626
where
2727
not isExcluded(fc, BannedPackage::terminationFunctionsOfStdlibhUsedQuery()) and
2828
f = fc.getTarget()
29-
select fc, "Call to banned function $@.", f, f.getName()
29+
select fc, "Call to banned function " + f.getName() + "."

c/misra/src/rules/RULE-21-8/TerminationMacrosOfStdlibhUsed.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ from MacroInvocation mi, BannedMacro m
2323
where
2424
not isExcluded(mi, BannedPackage::terminationMacrosOfStdlibhUsedQuery()) and
2525
m.getAnInvocation() = mi
26-
select mi, "Use of banned macro $@.", m, m.getName()
26+
select mi, "Use of banned macro " + m.getName() + "."
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
| test.c:10:3:10:6 | call to exit | Call to banned function $@. | stdlib.h:46:16:46:19 | exit | exit |
2-
| test.c:11:3:11:8 | call to system | Call to banned function $@. | stdlib.h:53:5:53:10 | system | system |
3-
| test.c:12:3:12:7 | call to abort | Call to banned function $@. | stdlib.h:44:16:44:20 | abort | abort |
4-
| test.c:14:3:14:9 | call to exit | Call to banned function $@. | stdlib.h:46:16:46:19 | exit | exit |
5-
| test.c:15:3:15:7 | call to abort | Call to banned function $@. | stdlib.h:44:16:44:20 | abort | abort |
6-
| test.c:16:3:16:14 | call to system | Call to banned function $@. | stdlib.h:53:5:53:10 | system | system |
1+
| test.c:10:3:10:6 | call to exit | Call to banned function exit. |
2+
| test.c:11:3:11:8 | call to system | Call to banned function system. |
3+
| test.c:12:3:12:7 | call to abort | Call to banned function abort. |
4+
| test.c:14:3:14:9 | call to exit | Call to banned function exit. |
5+
| test.c:15:3:15:7 | call to abort | Call to banned function abort. |
6+
| test.c:16:3:16:14 | call to system | Call to banned function system. |
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| test.c:14:3:14:9 | EXIT(x) | Use of banned macro $@. | test.c:3:1:3:23 | #define EXIT(x) exit(x) | EXIT |
2-
| test.c:15:3:15:7 | ABORT | Use of banned macro $@. | test.c:4:1:4:21 | #define ABORT abort() | ABORT |
3-
| test.c:16:3:16:14 | SYSTEM(x) | Use of banned macro $@. | test.c:5:1:5:27 | #define SYSTEM(x) system(x) | SYSTEM |
1+
| test.c:14:3:14:9 | EXIT(x) | Use of banned macro EXIT. |
2+
| test.c:15:3:15:7 | ABORT | Use of banned macro ABORT. |
3+
| test.c:16:3:16:14 | SYSTEM(x) | Use of banned macro SYSTEM. |

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "stdlib.h"
1+
#include <stdlib.h>
22

33
#define EXIT(x) exit(x)
44
#define ABORT abort()

0 commit comments

Comments
 (0)