I have a weird issue when I have a function defined in a C library which use more than 8 parameters
fun testme(tc : UInt32, c : UInt32, p : UInt32, pw : UInt8*, pl : UInt32, s : UInt8*, sl : UInt32, h : UInt8*) : Int32
# If I call :
s = Array(UInt8).new()
s<<53<<2<<2;
Mylib.testme(1,1, 1, s, 3, s, 3, s)
The library gets a random value for the sl argument
But if I remove the first or the last argument from the function signature then I have the correct value for sl (which is 3 in my example). I wonder what could be wrong?
Then ‘bad slen’ prints a big number that seems random, e.g: 140213502345219, 140389596004355
(it is never the same), while ‘signed slen’ output the correct value (3).
But both size_t on the C side or UInt32 on the Crystal side are unsigned?