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) {
2020 if (p2 == 0 ) { // COMPLIANT
2121 return NULL ;
2222 }
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
2929 int x ;
3030 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
3434}
You can’t perform that action at this time.
0 commit comments