Skip to content

C++ Standard Environment

lbuild module: modm:stdc++

Refines the C++ language to make it easier to use on embedded targets. Depending on the module options, the compiler options are appended with either:

  • -fno-exceptions: no C++ exceptions.
  • -fno-rtti: no C++ run-time type information.

or:

  • -fexceptions: with C++ exceptions.
  • -frtti: with C++ run-time type information.

AVR

A partial port of GCC libstdc++ is provided: See https://github.com/modm-io/avr-libstdcpp.

Options

assert_on_exception

Assert on exception in stdlib. Set to False to save flash.

This option is only available for avr.

Default: yes
Inputs: [yes, no]

exceptions

C++ Exceptions

Enables the full use of C++ exception handling.

Check your code size

The inclusion of the stack unwind tables will increase your code size quite a bit. Check whether your target has enough memory for this!

This option is only available for rp, sam, stm32.

Default: no
Inputs: [yes, no]

rtti

C++ Runtime Type Information

Enables the full use of C++ runtime type information.

Check your code size

The inclusion of the RTTI information will increase your code size quite a bit. Check whether your target has enough memory for this!

This option is only available for rp, sam, stm32.

Default: no
Inputs: [yes, no]

safe_statics

C++ Safe Statics Initialization

Enables safe initialization of statics inside functions and interrupts. In case of recursive initialization the debug assertion cxa.guard.recursion is raised.

Further reading on this topic:

This option is only available for rp, sam, stm32.

Default: yes
Inputs: [yes, no]

Dependencies

modm:stdc++ modm_stdc++ modm: stdc++ modm_architecture_assert modm: architecture: assert modm_stdc++->modm_architecture_assert modm_stdc modm: stdc modm_stdc++->modm_stdc