Skip to content

Commit c803680

Browse files
committed
RULE-21-6: Simplify alert msg, remove std headers
1 parent cd0d4ac commit c803680

File tree

5 files changed

+10
-437
lines changed

5 files changed

+10
-437
lines changed

c/misra/src/rules/RULE-21-6/StandardLibraryInputoutputFunctionsUsed.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ where
4949
f.getName() = wcharInputOutput() and
5050
f.getFile().getBaseName() = "wchar.h"
5151
)
52-
select fc, "Call to banned function $@.", f, f.getName()
52+
select fc, "Call to banned function " + f.getName() + "."
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 $@. | stdio.h:117:5:117:9 | scanf | scanf |
2-
| test.c:9:5:9:10 | call to printf | Call to banned function $@. | stdio.h:107:5:107:10 | printf | printf |
3-
| test.c:16:16:16:21 | call to fgetwc | Call to banned function $@. | wchar.h:125:8:125:13 | fgetwc | fgetwc |
4-
| test.c:17:5:17:12 | call to putwchar | Call to banned function $@. | wchar.h:131:8:131:15 | putwchar | putwchar |
5-
| test.c:22:7:22:10 | call to puts | Call to banned function $@. | stdio.h:105:5:105:8 | puts | puts |
6-
| test.c:24:7:24:10 | call to puts | Call to banned function $@. | stdio.h:105:5:105:8 | puts | puts |
7-
| test.c:26:5:26:8 | call to puts | Call to banned function $@. | stdio.h:105:5:105:8 | puts | puts |
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. |

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

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#include "stdio.h"
2-
#include "wchar.h"
31
#include <errno.h>
42
#include <locale.h>
3+
#include <stdio.h>
54
#include <stdlib.h>
5+
#include <wchar.h>
66
void f1() {
77
int n;
88
while (scanf("%d", &n) == 1) // NON_COMPLIANT

0 commit comments

Comments
 (0)