File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
c/misra/test/rules/RULE-21-13 Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1- | test.c:15:12:15:22 | call to islower | The <ctype.h> function call to islower accepts an argument c3 that is not an unsigned char nor an EOF. |
2- | test.c:20:12:20:22 | call to isdigit | The <ctype.h> function call to isdigit accepts an argument c4 that is not an unsigned char nor an EOF. |
1+ | test.c:17:7:17:17 | call to islower | The <ctype.h> function call to islower accepts an argument c3 that is not an unsigned char nor an EOF. |
2+ | test.c:23:7:23:17 | call to isdigit | The <ctype.h> function call to isdigit accepts an argument c4 that is not an unsigned char nor an EOF. |
Original file line number Diff line number Diff line change 1- #include <stdio.h>
21#include <ctype.h>
2+ #include <stdio.h>
33
44void sample () {
55 unsigned char c1 = 'c' ;
6- int r1 = isalnum (c1 ); // COMPLIANT: ASCII 99 is within unsigned char range of [0, 255]
6+ int r1 = isalnum (
7+ c1 ); // COMPLIANT: ASCII 99 is within unsigned char range of [0, 255]
78 unsigned char x1 = EOF ;
89 unsigned char x2 = x1 ;
910 unsigned char c2 = x2 ;
@@ -12,12 +13,14 @@ void sample() {
1213 int x3 = 256 ;
1314 int x4 = x3 ;
1415 int c3 = x4 ;
15- int r3 = islower (c3 ); // NON_COMPLIANT: is outside unsigned char range of[0, 255]
16+ int r3 =
17+ islower (c3 ); // NON_COMPLIANT: is outside unsigned char range of[0, 255]
1618
1719 unsigned char x5 = EOF ;
1820 unsigned char x6 = x5 ;
1921 int c4 = x6 + 10000 ;
20- int r4 = isdigit (c4 ); // NON_COMPLIANT: is outside unsigned char range of[0, 255]
22+ int r4 =
23+ isdigit (c4 ); // NON_COMPLIANT: is outside unsigned char range of[0, 255]
2124}
2225
2326int main () { return 0 ; }
You can’t perform that action at this time.
0 commit comments