Good day,
we are currently working on an embedded system where C++ exceptions cannot be used and thus their support is deactivated in the compiler/linker settings. In this project, we get a IAR-linker error for a construct like in the simplified example below:
Code:
struct Bla
{
Bla():blup{3u}{}
uint8_t blup;
};
template<typename T, size_t N>
struct Warp
{
T bla[N];
};
int32_t main()
{
Warp<Bla,2> bla{};
return 0;
}
Message:
IAR ELF Linker V9.30.1.335/W64 for ARM
Copyright 2007-2022 IAR Systems AB.
Error[Li009]: runtime model conflict: Module iar_Raise.o(dlpprt6M_tl_nc.a)
specifies that '__CPP_Exceptions' must be 'Used', but module main.o
has the value 'Disabled'
The error does not show up as soon as no custom constructor is defined, or if it is explicitly defaulted or if it has nothing but an empty body. Why do we see this error and how could we get rid of it? We cannot figure out where this code requires exception handling.
Thank you very much for your help.