Skip to content

Commit 892227e

Browse files
committed
RULE-21-4: Simplify alert message, remove setjmp.h
1 parent 273ceb2 commit 892227e

File tree

4 files changed

+5
-46
lines changed

4 files changed

+5
-46
lines changed

c/misra/src/rules/RULE-21-4/StandardHeaderFileUsedSetjmph.ql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,18 @@ class LongJmp extends Function {
2727
}
2828
}
2929

30-
from Locatable use, Locatable feature, string name
30+
from Locatable use, string name
3131
where
3232
not isExcluded(use, BannedPackage::standardHeaderFileUsedSetjmphQuery()) and
3333
(
3434
exists(SetJmp setjmp |
35-
feature = setjmp and
3635
use = setjmp.getAnInvocation() and
3736
name = "setjmp"
3837
)
3938
or
4039
exists(LongJmp longjmp |
41-
feature = longjmp and
4240
use = longjmp.getACallToThisFunction() and
4341
name = "longjmp"
4442
)
4543
)
46-
select use, "Use of $@.", feature, name
44+
select use, "Use of " + name + "."
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| test.c:7:7:7:12 | setjmp | Use of $@. | setjmp.h:33:1:33:21 | #define setjmp setjmp | setjmp |
2-
| test.c:8:3:8:9 | call to longjmp | Use of $@. | setjmp.h:31:16:31:22 | longjmp | longjmp |
1+
| test.c:7:7:7:12 | setjmp | Use of setjmp. |
2+
| test.c:8:3:8:9 | call to longjmp | Use of longjmp. |

c/misra/test/rules/RULE-21-4/setjmp.h

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

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

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

33
void f1() {
44
jmp_buf env; // COMPLIANT - Assumption of features outlined in rule is

0 commit comments

Comments
 (0)