File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
c/misra/test/rules/RULE-11-9 Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -20,15 +20,15 @@ void *f1(void *p1, int p2) {
20
20
if (p2 == 0 ) { // COMPLIANT
21
21
return NULL ;
22
22
}
23
- p2 ? p1 : 0 ; // NON_COMPLIANT
24
- p2 ? 0 : p1 ; // NON_COMPLIANT
25
- p2 ? (void * ) 0 : p1 ; // COMPLIANT
26
- p2 ? p1 : (void * ) 0 ; // COMPLIANT
27
- p2 ? p2 : 0 ; // COMPLIANT - p2 is not a pointer type
28
- p2 ? 0 : p2 ; // COMPLIANT - p2 is not a pointer type
23
+ p2 ? p1 : 0 ; // NON_COMPLIANT
24
+ p2 ? 0 : p1 ; // NON_COMPLIANT
25
+ p2 ? (void * ) 0 : p1 ; // COMPLIANT
26
+ p2 ? p1 : (void * ) 0 ; // COMPLIANT
27
+ p2 ? p2 : 0 ; // COMPLIANT - p2 is not a pointer type
28
+ p2 ? 0 : p2 ; // COMPLIANT - p2 is not a pointer type
29
29
int x ;
30
30
int * y ;
31
- p2 ? (p1 = 0 ) : p1 ; // NON_COMPLIANT - p1 is a pointer type
32
- p2 ? (p2 = 0 ) : p1 ; // COMPLIANT - p2 is not a pointer type
33
- return 0 ; // COMPLIANT
31
+ p2 ? (p1 = 0 ) : p1 ; // NON_COMPLIANT - p1 is a pointer type
32
+ p2 ? (p2 = 0 ) : p1 ; // COMPLIANT - p2 is not a pointer type
33
+ return 0 ; // COMPLIANT
34
34
}
You can’t perform that action at this time.
0 commit comments