This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Whiy do memory allocation functions return a void pointer ?

The answer seems obvious, but considering this MISRA rule

Rule 11.5 A conversion should not be performed from pointer to void into
pointer to object

would it not be safer to have memory allocation functions like "malloc" return a pointer to a char* instead? This type of pointer has no alignment issues.

Thanks.

0