Is it possible to enable libc ++ debug checks?

I was wondering if any debug checks for libc ++ could be enabled. One of my favorite things about the MSVC STL is that it sometimes tries to find errors from the start (although it would be easier for me to turn off the speed). After looking at the headers, I tried:

#define _LIBCPP_DEBUG_LEVEL 2

      

However, this results in build errors ('__get_db undeclared'). Any information on whether this is a work in progress or if there is another expected way to enable these checks?

+1


source to share


2 answers


It's definitely a job. There's a (very old) status page here that I need to update.

The idea is that users will interact with it by setting the preprocessor symbol. _LIBCPP_DEBUG

A simple definition will give basic tests by setting it to a number> 1 to give more extensive tests.



However, as you discovered, it is currently not working.

+2


source


It seems that some progress has been made during this time. At least there is some documentation that doesn't state that debug mode is horribly broken.

As stated in the docs I link, debug mode should be controlled by specifying _LIBCPP_DEBUG

either 0 or 1; the macro _LIBCPP_DEBUG_LEVEL

is represented by some internal switch.



However, when looking at a question like this , spurious compilation errors can occur.

+1


source







All Articles