NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/48560: kevent.udata and void *

The following reply was made to PR kern/48560; it has been noted by GNATS.

From: (Christos Zoulas)
Subject: Re: kern/48560: kevent.udata and void *
Date: Wed, 29 Jan 2014 11:41:17 -0500

 On Jan 29,  1:45pm, 
( wrote:
 -- Subject: kern/48560: kevent.udata and void *
 | For src/sys/sys/event.h
 | I am told that kevent.udata should maybe be void * since C++ doesn't 
 | allow the naive conversion from a pointer type to integer. Apparently 
 | some other systems have that has void *
 | error: invalid conversion from 'char*' to '__intptr_t'
 | I am not sure what prompted the change.
 | See
 | for an example of __NetBSD__ workaround.
 I believe this was done deliberately so that the "opaque user
 identifier" was not just a pointer but an integer type (to indicate
 that this does not necessary hold a pointer but it *can* hold one).
 Nevertheless the reinterpret_cast<type *>(e->udata) takes care of
 the issue. In C++ need a static_cast anyway since "void *" is not
 fungible with other pointers (unless of course you are assigning to
 "void *".

Home | Main Index | Thread Index | Old Index