http://bugs.winehq.org/show_bug.cgi?id=17107
Summary: compiler warnings in server/fd.c on NetBSD Product: Wine Version: 1.1.13 Platform: PC OS/Version: NetBSD Status: NEW Keywords: download, source Severity: enhancement Priority: P2 Component: wineserver AssignedTo: wine-bugs@winehq.org ReportedBy: austinenglish@gmail.com
fd.c: In function 'set_fd_epoll_events': fd.c:580: warning: assignment makes integer from pointer without a cast fd.c:581: warning: assignment makes integer from pointer without a cast
Only appears on NetBSD, but not OpenBSD/FreeBSD. Vincent Povirk helped me investigate on IRC, and looks like the problem is that on FreeBSD, in /usr/include/sys/event.h you've got: struct kevent { uintptr_t ident; /* identifier for this event */ short filter; /* filter for event */ u_short flags; u_int fflags; intptr_t data; void *udata; /* opaque user data identifier */ };
But on NetBSD:
struct kevent { uintptr_t ident; /* identifier for this event */ uint32_t filter; /* filter for event */ uint32_t flags; /* action flags for kqueue */ uint32_t fflags; /* filter flag value */ int64_t data; /* filter data value */ intptr_t udata; /* opaque user data identifier */ };
Note the difference in udata 'void *' vs 'intptr_t'.
Relevant lines from the code: EV_SET( &ev[0], fd->unix_fd, EVFILT_READ, 0, NOTE_LOWAT, 1, (void *)user ); EV_SET( &ev[1], fd->unix_fd, EVFILT_WRITE, 0, NOTE_LOWAT, 1, (void *)user );
removing (void *) or changing it to intptr_t fixes the warning, but doesn't seem a proper fix. Probably needs an ifdef or typedef, but I'll leave that for someone else to decide.