On 2025-09-12 21:22:31 +0200, Vincent Lefevre wrote:
> On 2025-09-12 18:32:12 +0200, noneofyourbusiness wrote:
> > This line achieves this while maintaining compatibility with other
> > C compilers:
> >     //usr/bin/env tcc -run "$0" ; exit $?
> 
> This should probably be the official recommendation, though I would
> rather prefer
> 
>   // 2> /dev/null ; exec tcc -run "$0"
> 
> so that the shell is replaced by tcc (instead of having tcc run as
> a child of the shell, which is just waiting for tcc to exit).

These lines do not support program arguments.
https://wiki.gentoo.org/wiki/Tcc gives

  //usr/bin/env tcc -run "$0" "$@" ; exit $?

So, likewise, I would prefer

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

-- 
Vincent Lefèvre <[email protected]> - 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
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to