Core was generated by `XYZXYZ'. Program terminated with signal 11, Segmentation fault. #0 0x400000000002f320 in std::_Rb_tree<X, X, std::_Identity<X>, std::less<X>, std::allocator<X> >::insert_unique () (gdb) backtrace #0 0x400000000002f320 in std::_Rb_tree<X, X, std::_Identity<X>, std::less<X>, std::allocator<X> >::insert_unique () #1 0x4000000000002aa0 in main??unw ()
>>400 規格の 7.5p1 より "Two function types with different language linkages are distinct types even if they are otherwise identical." ということで C++ language linkage を持つ C のメンバ関数 callback() は C language linkage を持つ register_callback() の引数 callback とは型が違うことになる。
Linkage from C++ to objects defined in other languages and to objects defined in C++ from other languages is implementation-defined and language-dependent. Only where the object layout strategies of two language implementations are similar enough can such linkage be archived.