This is the documentation for the latest (main) development branch of Zephyr. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

CONFIG_ASSERT

Enable __ASSERT() macro

Type: bool

Help

This enables the __ASSERT() macro in the kernel code. If an assertion
fails, the policy for what to do is controlled by the implementation
of the assert_post_action() function, which by default will trigger
a fatal error.

Disabling this option will cause assertions to compile to nothing,
improving performance and system footprint.

Default

Kconfig definition

At subsys/debug/Kconfig:192

Included via Kconfig:8Kconfig.zephyr:42subsys/Kconfig:17

Menu path: (Top) → Sub Systems and OS Services → Debugging Options

config ASSERT
    bool "Enable __ASSERT() macro"
    default y if TEST
    help
      This enables the __ASSERT() macro in the kernel code. If an assertion
      fails, the policy for what to do is controlled by the implementation
      of the assert_post_action() function, which by default will trigger
      a fatal error.

      Disabling this option will cause assertions to compile to nothing,
      improving performance and system footprint.

(The ‘depends on’ condition includes propagated dependencies from ifs and menus.)