On 2025-09-12 23:53:33 +0200, noneofyourbusiness via Tinycc-devel wrote:
> Vincent Lefevre <vinc...@vinc17.net> wrote:
> > No, the "$@" needs to be at the end:
> > Otherwise this gives
> > tcc: error: file 'ab' not found
> 
> Well, that is a significant limitation.
> Either you have working options, or you have working arguments to the program.
> Focusing on arguments to the program makes sense since you can just
> hardcode the arguments to tcc.

This is the general behavior when running scripts by just using
the program name + arguments: arguments on the command line are
always the program arguments, not the arguments of the interpreter.

> Another even more unhinged option would be:
> // 2>/dev/null ; exec tcc "$@"
> where you would do e.g. ./42.c -static -run ./42.c 2a 9

In practice, I would expect tcc to be run as usual scripts:
the arguments are just the program arguments.

This is the whole idea: the invocation does not depend on how
the program is implemented.

An alternative could be

// 2> /dev/null ; exec tcc $TCC_OPTS -run "$0" "$@"

or whatever you want in place of $TCC_OPTS (e.g. $CFLAGS).

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to