Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
11.5: Conversion from point to void
#3
For functions which take arbitrary data and operate on it in a byte-wise fashion, for example, calculating a CRC, which would be the preferred method according to the MISRA guidelines:

Code:
uint32_t CRC(size_t length, void * data);
which internally converts data to a pointer to uint8_t (with the requisite deviation), or

Code:
uint32_t CRC(size_t length, uint8_t * data);
and would this require an explicit cast to pointer to uint8_t at each calling location? Or would the Exception to 11.3 allow for an implicit conversion?
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)