Upcoming asyncdispatch doesn't compile with C++ backend on OS X #4928

Closed
endragor opened this Issue Oct 22, 2016 · 0 comments

Projects

None yet

1 participant

@endragor
Contributor
import upcoming.asyncdispatch
poll()

Compiling that on OS X with nim cpp yields this error:

stdlib_ioselectors.cpp:558:10: error: no matching function for call to 'sysctl'
                LOC3 = sysctl((&namearr0[(((NI) 0))- 0]), ((unsigned int) 2), ((void*) ((&maxfd0))), (&size0), NIM_NIL, ((NI) 0));
                       ^~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/sys/sysctl.h:759:5: note: candidate function not viable: no known conversion from 'NI *' (aka 'long long *') to 'size_t *' (aka 'unsigned long *') for 4th argument
int     sysctl(int *, u_int, void *, size_t *, void *, size_t);

It seems the problem is that sysctl is wrapped with incorrect signature and C backend gets away with that because of C's loose type checking.

@Araq Araq pushed a commit that closed this issue Oct 22, 2016
@cheatfate cheatfate Fix #4928 406878e
@Araq Araq closed this in 406878e Oct 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment