debuggingvisual-c++clang

What does the MSVC Debug Runtime do?


I'm considering building my code with clang/clang++ instead of clang-cl. I compile with /MT or /MTd depending on whether I'm making a debug or release build but it seems clang/clang++ always uses the non debug runtime as if compiled with /MT. I don't really know what the debug runtime does, is there anything I'll miss out on if I'm not using it?


Solution

  • The debug runtime differs primarily in a sightly different ABI for iterators, which prohibits mixture (both static linkage and dynamic linkage with STL based interface) of libraries compiled with debug/release. That's why some of the frontends will avoid the debug runtime at any cost.

    Those extra features are primarily for iterator validation, and iterator validation is therefore unavailable with the release runtime.

    That be said - the use of ASAN can replace iterator validation entirely, so you are not actually loosing anything of worth.

    All of the other "debug" or "validation" features like debug-heaps etc. are available in the "release" version of the runtime too.