The stability check in analog_filter.hpp uses a throw expression:
throw "constfilt: unstable analog filter";
This is incompatible with -fno-exceptions, which is standard practice on embedded and freestanding targets (aka bare metal). The compiler rejects any throw expression at the point of compilation, even if the branch is never reached, so the library fails to build entirely on its primary intended targets.
The check also assumes stdlib availability for any fallback (std::terminate, std::abort), which cannot be assumed in freestanding builds.
Current state: the check block is commented out in analog_filter.hpp. CheckStab template parameter is reserved but inert.
Candidate approaches:
__builtin_trap(): preserves the compile-time error via the non-constexpr call rule, but is GCC/Clang specific.
- Undeclared
[[noreturn]] customization point: portable, user supplies the handler per platform; compile-time error still works via the non-constexpr call rule; linker error if the user forgets to define it.
The customization point approach is the likely path forward.
The stability check in
analog_filter.hppuses athrowexpression:This is incompatible with
-fno-exceptions, which is standard practice on embedded and freestanding targets (aka bare metal). The compiler rejects anythrowexpression at the point of compilation, even if the branch is never reached, so the library fails to build entirely on its primary intended targets.The check also assumes stdlib availability for any fallback (
std::terminate,std::abort), which cannot be assumed in freestanding builds.Current state: the check block is commented out in
analog_filter.hpp.CheckStabtemplate parameter is reserved but inert.Candidate approaches:
__builtin_trap(): preserves the compile-time error via the non-constexpr call rule, but is GCC/Clang specific.[[noreturn]]customization point: portable, user supplies the handler per platform; compile-time error still works via the non-constexpr call rule; linker error if the user forgets to define it.The customization point approach is the likely path forward.