>>> from cffi import FFI >>> ffi = FFI() >>> ffi.cdef(""" ... int printf(const char *format, ...); // copy- pasted from the man page ... """) >>> C = ffi.dlopen(None) >>> arg = ffi.new("char[]", "world") >>> C.printf("hi there, %s!\n", arg); 17
pycparser 2.07
libffi5/libffi-dev 3.0.10-3
Debian with 3.2.0-2-pae x86
From man 3 printf: "These functions return the number of characters printed (not including the trailing `\0' used to end output to strings) or a negative value if an output error occurs". So the 17 makes sense, but where did the output go?!
pycparser 2.07
libffi5/libffi-dev 3.0.10-3
Debian with 3.2.0-2-pae x86