Hi
We are using HeapMem_alloc() and it requires an "Error_Block" object to catch asserts. We've noticed that we can compile link the code using #include <xdc/runtime/Error.h> without having this in the .cfg file
var Error = xdc.useModule('xdc.runtime.Error')
Will the error module still "work" without the above .cfg file text? What will happen when we use Erro_getCode()?
Cheers
The rule is: Whenever you need to a module's header in your C code, there should be a corresponding xdc.useModule() call in your CFG script. Sometimes you may get away with breaking this rule, if you are calling xdc.useModule() an another module, which then calls xdc.useModule() on the original module (xdc.runtime.Error in your case).
If you don't call xdc.useModule(), but you are calling the module's functions in your C code, you could get linker errors.
If my reply answers your question please mark the thread as answered.