Error reporting from C functions