tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] env executable examples


From: David Mertens
Subject: Re: [Tinycc-devel] env executable examples
Date: Thu, 10 May 2012 09:05:35 -0500

Couldn't we just create the binary called tcc-run, so users could say

#!/usr/bin/env tcc-run

at the top of their files?

On Thu, May 10, 2012 at 8:53 AM, Thomas Preud'homme <address@hidden> wrote:
Le jeudi 10 mai 2012 15:50:00, Thomas Preud'homme a écrit :
> Greetings everybody,
>
> I've just realized that the env trick to use tcc from the correct place [1]
> doesn't work because neither Linux nor env split arguments at spaces.
>
> [1] See commit 27a428cd0fae475d7377e1dbe218c064ee217d85
>
> Basically /usr/bin/env tcc -run will try to find "tcc -run" which is then
> obviously not found. Should we go back to the solution proposed in [2] or
> do you have another idea?
>
> [2] cb2138f8b098feb1b51a407343a4b99e25d5b506
>
> Best regards,
>
> Thomas Preud'homme

Actually I've just realized another solution would be to search for a shebang
to tcc when there is only one parameter and this is a c file.

This way we could do /usr/bin/env tcc and tcc would know it must run the
TCC_OUTPUT_MEMORY option. The problem would then be that a file starting with a
valid shebang could not be compiled & linked with tcc. It would break
potential script doing tcc $file && ./a.out

What do you think?

Best regards,

Thomas Preud'homme

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




--
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]