Enabling Debugging Features

Four macros control certain debugging features. In general, it is useful to compile with these features on for development code, and off for production code, because the features may decrease performance. The table below summarizes the macros and their default values. A value of 1 enables the corresponding feature; a value of 0 disables the feature.

Debugging Macros


Default Value



Windows* OS:

1 if _DEBUG is defined,

0 otherwise.

Default value for all other macros in this table.

All other systems: 0.



Enable internal assertion checking. Can significantly slow performance.


Enable full support for Intel® Parallel Studio XE analysis tools.


Enable warnings about performance issues.


The macro TBB_USE_ASSERT controls whether error checking is enabled in the header files. Define TBB_USE_ASSERT as 1 to enable error checking.

If an error is detected, the library prints an error message on stderr and calls the standard C routine abort. To stop a program when internal error checking detects a failure, place a breakpoint on tbb::assertion_failure.


On Microsoft Windows* operating systems, debug builds implicitly set TBB_USE_ASSERT to 1 by default


The macro TBB_USE_THREADING_TOOLS controls support for Intel® Inspector XE, Intel® VTune™ Amplifier XE and Intel® Advisor.

Define TBB_USE_THREADING_TOOLS as 1 to enable full support for these tools. Leave TBB_USE_THREADING_TOOLS undefined or zero to enable top performance in release builds, at the expense of turning off some support for tools.


The macro TBB_USE_PERFORMANCE_WARNINGS controls performance warnings. Define it to be 1 to enable the warnings. Currently, the warnings affected are:

  • Some that report poor hash functions for concurrent_hash_map. Enabling the warnings may impact performance.

  • Slow misaligned 8-byte atomic stores in 32-bit programs for Intel® processors.

For more complete information about compiler optimizations, see our Optimization Notice.