Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Misra rule 45
#2
Answer: MISRA C Steering Team 5/1/06

unsigned char data[1];
memset(&data,0x00,sizeof(data));

The example above is not in violation of either Rule 45 or 77.

void * is compatible with any other pointer, and therefore no cast is required.

See 6.2.2.3 in ISO C 9899:1990.

Rule 45 can only be violated by a cast.


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)