tech-pkg archive

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

Re: more fun with MySQL cluster (actually C++)



On Fri, Sep 25, 2020 at 11:38:12PM -0700, John Nemeth wrote:
> On the -9 box, kev.udata (from <sys/event.h>) is defined as intptr_t,
> but on -current, kev.udata is defined as void *.  With the EV_SET,
> the error has to do with the last argument.  On the -9 box, it is
> defined as intptr_t, but on -current, it is defined as void *.
> 
>      I don't do C++.  The code in question looks like:
> 
> -----
>     if (kev.filter == EVFILT_TIMER) {
>       timer = static_cast<my_timer_t *>(kev.udata);
> -----

Someone else who understands C++'s type system better than me can
probably offer a better response, but essentially static_cast is a
stricter cast than standard C casts.

reinterpret_cast allows you to do 'unsafe' C-style casts.

The other BSDs all define it as void * and it was changed at some
point exactly because of this (compatibility with C++ code written
for FreeBSD).


Home | Main Index | Thread Index | Old Index