Exceptions may be thrown from C interface functions #163
Open
Description
It is undefined behavior to throw exceptions from functions marked extern "C". Yet, createNomadProblem does just this. Probably it should use new(std::nothrow) instead of plain new when creating the NomadProblemInfo, exiting early if the allocation fails, and also catch std::bad_alloc when creating the shared pointer. solveNomadProblem also creates a shared pointer without catching std::bad_alloc.
I have not looked at the NOMAD::AllParameters methods to see if they may throw as well. If they may, then exceptions must be similarly caught.
Metadata
Assignees
Labels
No labels