You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
modm_assert_debug() resolves into a no-op for release mode, which isn't useful.
modm_assert() is recoverable by the user by returing Ignore from the assertion handler.
modm_abort() or similar should be added that ignores the assertion handlers and always abandons. Or should there be a way to call modm_abandon() directly?
the failure string is too costly and too restrictive:
there isn't always a clear module, location and failure, leading to duplicated module and location strings.
there should only be one string passed as the reason, and the library developer is responsible for creating namespaced, unique failure strings. A naming convention inspired by reverse-domain notation (ie. separation by . dots) could be encouraged.
strings should optionally be placed into a GNU comment section and only their index is passed to the assertion handlers (there needs to be a way to reverse lookup this).
The text was updated successfully, but these errors were encountered:
There should be a short error location string given, and also a full text reason that is placed only in the ELF file. In addition the call location (PC?) should be recorded, with an optional stack backtrace printer for the abandon handler.
Assertions were intended as a low-cost alternative to C++ exceptions, see https://blog.salkinium.com/xpccs-error-model/.
However, there are three issues:
modm_assert_debug()
resolves into a no-op for release mode, which isn't useful.modm_assert()
is recoverable by the user by returing Ignore from the assertion handler.modm_abort()
or similar should be added that ignores the assertion handlers and always abandons. Or should there be a way to callmodm_abandon()
directly?.
dots) could be encouraged.The text was updated successfully, but these errors were encountered: