On 8 April 2014 09:34, Eric Botcazou <ebotca...@adacore.com> wrote: >> Since you've found that, can you provide your answer to the objection >> raised back then, that this is not permitted by the semihosting API >> which we are implementing here? > > I don't understand the question: what is not permitted exactly?
The reason we only exit with zero here is because the semihosting API doesn't provide a way for the application to report a non-zero exit code. In this case you're distinguishing "application exit" from the other failure reasons, which seems OK, though. I'm just wary of patches trying to fix this issue because in the past they've generally ignored the fact that we're implementing a fixed API here and can't make random additions to it just because they happen to work with newlib or whatever. Returning a negative exit code is bogus, though. You probably just want if (args == ADP_Stopped_ApplicationExit) { code = EXIT_SUCCESS; } else { code = EXIT_FAILURE; } thanks -- PMM