File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2581,8 +2581,6 @@ def misra_11_6(self, data):
25812581 for token in data .tokenlist :
25822582 if not isCast (token ):
25832583 continue
2584- if token .astOperand1 .astOperand1 :
2585- continue
25862584 vt1 = token .valueType
25872585 vt2 = token .astOperand1 .valueType
25882586 if not vt1 or not vt2 :
Original file line number Diff line number Diff line change @@ -836,10 +836,17 @@ static void misra_11_5(void *p) {
836836 p16 = p ; // 11.5
837837}
838838
839+ static intptr_t get_intptr_constant (void ) { return 456 ; }
839840static void misra_11_6 (void ) {
840841 void * p ;
842+ struct {
843+ int i ;
844+ } s = { .i = 7 };
841845 p = (void * )123 ; // 11.6
842846 x = (u64 )p ; // 11.6
847+ p = (void * )(1 + 1 );// 11.6
848+ p = (void * )get_intptr_constant (); // 11.6
849+ p = (void * )s .i ; // 11.6
843850 p = ( void * )0 ; // no-warning
844851 (void )p ; // no-warning
845852 // # 12184
You can’t perform that action at this time.
0 commit comments