Closed vsergeev closed 3 years ago
local ffi = jit and require('ffi') or require('cffi') ffi.cdef[[ int pipe(int fildes[2]); ]] --[[ -- also: local buf = ffi.new('int [2]') local pipe_fds = ffi.cast('int *', buf) ]]-- local pipe_fds = ffi.new('int [2]') ffi.C.pipe(pipe_fds) --> expected: no error, get: cannot convert 'int *' to 'int [2]' print(pipe_fds[0]) --> 3 print(pipe_fds[1]) --> 4
It appears that cdata<T [N]> and cdata<T *> types cannot be passed as an argument to a function expecting T [N].
cdata<T [N]>
cdata<T *>
T [N]
It appears that
cdata<T [N]>
andcdata<T *>
types cannot be passed as an argument to a function expectingT [N]
.