itanium-abi

Type trait to identify primary base class

烂漫一生 提交于 2019-12-30 08:23:10
问题 If I have a class Base, with at least one virtual function, and a class Derived which inherits singly from this then (uintptr_t)derived - (uintptr_t)static_cast<Base*>(derived) is guaranteed (by the Itanium ABI) to be zero, even though Derived is not standard layout. However in the general case this is not necessarily true (eg. multiple inheritance). Is it possible to write a trait which can be used to detect if one class is the primary base class of another? Useful sections from the Itanium

Type trait to identify primary base class

旧城冷巷雨未停 提交于 2019-12-01 04:13:20
If I have a class Base, with at least one virtual function, and a class Derived which inherits singly from this then (uintptr_t)derived - (uintptr_t)static_cast<Base*>(derived) is guaranteed (by the Itanium ABI) to be zero, even though Derived is not standard layout. However in the general case this is not necessarily true (eg. multiple inheritance). Is it possible to write a trait which can be used to detect if one class is the primary base class of another? Useful sections from the Itanium ABI: http://refspecs.linux-foundation.org/cxxabi-1.83.html Primary base class For a dynamic class, the

GCC vs MS C++ compiler for maintaining API backwards binary compatibility

风格不统一 提交于 2019-11-28 18:48:37
I came from the Linux world and know a lot of articles about maintaining backwards binary compatibility (BC) of a dynamic library API written in C++ language. One of them is "Policies/Binary Compatibility Issues With C++" based on the Itanium C++ ABI , which is used by the GCC compiler. But I can't find anything similar for the Microsoft C++ compiler (from MSVC). I understand that most of the techniques are applicable to the MS C++ compiler and I would like to discover compiler-specific issues related to ABI differences (v-table layout, mangling, etc.) So, my questions are the following: Do

GCC vs MS C++ compiler for maintaining API backwards binary compatibility

自作多情 提交于 2019-11-27 11:40:31
问题 I came from the Linux world and know a lot of articles about maintaining backwards binary compatibility (BC) of a dynamic library API written in C++ language. One of them is "Policies/Binary Compatibility Issues With C++" based on the Itanium C++ ABI, which is used by the GCC compiler. But I can't find anything similar for the Microsoft C++ compiler (from MSVC). I understand that most of the techniques are applicable to the MS C++ compiler and I would like to discover compiler-specific issues