On Tue, Apr 7, 2020 at 10:45 AM Brooks Davis <bro...@freebsd.org> wrote:
> On Tue, Apr 07, 2020 at 07:32:37PM +0200, Hans Petter Selasky wrote:
> > Is there a reason for using "void *" here?
> >
> > char *ifr_addr_get_data(void *ifrp);
>
> Because the type is unknown at this point (it may be struct ifreq or
> struct ifreq32 (or in CheriBSD struct ifreq64)).  By using "void *" here
> we avoid the need to insert a wrong cast.

I think the question (or my question anyway) is: why void*, and not a
union pointer?  A union pointer would never be a wrong cast for the
caller, and inherent in this design is essentially treating the
pointer as a union on the callee side of things.

Thanks,
Conrad
_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to