Quoth adr <a...@sdf.org>:
> 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*.
> 

char* has legitimate uses for things other than generic pointers,
and the conversion complaints catch bugs.


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

Reply via email to