In C++, is it safe/portable to use static member function pointer for C API callbacks?
It is not safe per the C++ standard. As stated in this SO posting: A C callback function implemented in C++ must be extern “C”. It may seem to work as a static function in a class because class-static functions often use the same calling convention as a C function. However, doing that is a bug waiting to happen (see comments below), so please don’t – go through an extern “C” wrapper instead. And according to comments made by Martin York in that answer there are real-world problems trying to do so on some platforms. Make your C ABI callbacks extern “C”.