On 12.12.2024 21:37, Scott Graham wrote:
Hi,
On origin/mob, before
https://repo.or.cz/tinycc.git/commit/dd2e5f8b06bc6ada943291fa4c67c8397038310f
the exit code of a script executed with `tcc -run` was the return code of its
main(), which I found useful for getting return codes from scripts.
After, though, it's been forced to be always 1 if non-zero:
https://repo.or.cz/tinycc.git/blobdiff/3eb6352c52b92143bd0590ea3015ad0342890edb..dd2e5f8b06bc6ada943291fa4c67c8397038310f:/tcc.c
(rather than using s->nb_errors).
It looks like that was intentional (maybe to do with running tests?).
Well, the intention was not to rely on s->nb_errors only because that
was causing an endless loop when some parts of the code (probably
tcc_load_archive) happened to return 'ret = -1' but without any
error message.
But would it make sense to restore the behaviour for normal `tcc -run` uses?
Sure it makes sense. Fixed now. (The logic still relies on 'ret' in
the first place but keeps its original value when s->nb_errors == 0.
Thanks, --gr
scott
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel