C function calls throw exceptions