I am currently working on a project which requires the code to be Misra 2012 compliant. Throughout the project we have lots of required misra warnings telling us we cant convert pointer to one type to a pointer to another type. Things as simple as void *memcpy(void *to, const void *from, size_t n)
produce two Misra Required warnings since both to and from need to be type-casted to void* and const void* respectively.
Conversion from void* to a pointer to any other type also gives a Misra warning.
My question is how does Misra expect malloc and everything else to work without any warnings being thrown? Even converting a void* buffer to uint8_t* buffer to parse abuffer byte by byte and fill up all the elements of a structure structure will throw numerous warnings?
Instead of these warnings could it not just show use a note or info asking us to double check packing, alignment and anything else that might go wrong?