-
Notifications
You must be signed in to change notification settings - Fork 25
Error on arm32 #6
Copy link
Copy link
Open
Description
Hello !
Testing your project with with the apk on android arm32 (nexus7) this program fail:
local ffi = require('ffi')
local buf = ffi.new('char[256]')
local c = ffi.C
ffi.cdef('int sprintf(char *buf, const char *fmt, ...);')
print(c.sprintf(buf, '%g', 5.3), ffi.string(buf));
Expected:
3 5.3
Output:
11 2.14609e+41
The above and the following are from the original test.lua and it also fail the following with segfault:
-- unsigned should be ignored for pointer rules
ffi.cdef([=[
int strncmp(const signed char *s1, const unsigned char *s2, size_t n);
]=]);
assert(ffi.C.strncmp("two", "three", 3) ~= 0); -- segfault here
...
-- Test io.tmpfile()
ffi.cdef ([=[
int fprintf ( FILE * stream, const char * format, ... );
]=]);
local f = io.tmpfile();
ffi.C.fprintf(f, "test: %s\n", "foo"); -- segfault here
f:seek("set", 0);
local str = f:read('*l');
assert(str == 'test: foo', str);
f:close();
Commenting the above mentioned tests all the rest of test.lua pass.
Great work !
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels