Mixing RTTI flags in C++

How RTTI information is stored is an implementation detail and thus not portable across different compilers.

Also most compilers do not even guarantee that objects compiled with different flags will use the same ABI for their methods. This is most prominently shown with release and debug libraries but other flags can cause differences as well.

Not only may the ABI for functions/methods change but flags can affect the padding used by the compiler between elements in structures thus even objects without virtual methods may be incompatible when compiled with different flags.

When using most IDS you can see the effects. Debug/Release binaries are built into separate directories and only linked against the same kind of binary (also any user defined build will be built into a separate unique directory as a difference in flags may cause incompatibilities). If you change certain flags on a build then the whole project is usually forced to re-build.

Tags:

C++

Rtti