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_LEVEL

__ASSERT() level

Type: int

Help

This option specifies the assertion level used by the __ASSERT()
macro. It can be set to one of three possible values:

Level 0: off
Level 1: on + warning in every file that includes __assert.h
Level 2: on + no warning

Direct dependencies

ASSERT

(Includes any dependencies from ifs and menus.)

Default

  • 2

Kconfig definition

At subsys/debug/Kconfig:204

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

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

config ASSERT_LEVEL
    int "__ASSERT() level"
    range 0 2
    default 2
    depends on ASSERT
    help
      This option specifies the assertion level used by the __ASSERT()
      macro. It can be set to one of three possible values:

      Level 0: off
      Level 1: on + warning in every file that includes __assert.h
      Level 2: on + no warning

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