On Sun, 15 May 2022, arn...@skeeve.com wrote:

It allows you pass pointers of any type without requiring casts:

       struct foo s[5] = ...
       memmove(s, & s[1], 4 * sizeof(struct foo));     // shift down 1

The compiler won't complain because any pointer type can be passed
to a void* parameter.  Otherwise you'd need to cast:

       memmove((uchar*) s, (uchar*) & s[1], 4 * sizeof(struct foo));

Sure, but you could change it to do the same with char*.

void* has been standard practice (even on Plan 9) for 30+ years.
It's not worth changing it now. :-)

I agree, I just wanted to share some opinions.

Regards,
adr.

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tecaea3b9ec8e7066-M9bc3acdf4dd19efb75ea5a51
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to