[Top][All Lists]

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

Re: [Tinycc-devel] Using TCC as a backbone for our compiler

Subject: Re: [Tinycc-devel] Using TCC as a backbone for our compiler
Date: Mon, 15 Jun 2009 19:06:14 +0200
User-agent: Mozilla-Thunderbird (X11/20090103)

Jerome St-Louis wrote:
On Mon, Jun 15, 2009 at 9:57 AM, grischka<address@hidden> wrote:

TCC supports statement expressions, such as:

   return ({ int a=4, b=3; a+b; });

Maybe this is all we need... I will then give TCC a try at compiling
our .c files.

Another problem is that there are some issues with C code generation,
such as required prototyping and reordering of declarations which
causes us many headaches ...
I see.  Actually TCC treats function and struct ptr mismatch as
errors,  however it could be made warnings as needed.

Sorry I'm not sure I follow this ? Which mismatches are you talking
about? (Did you look at produced eC intermediate C files which gives
out tons of GCC warnings hehe?)

My feeling is that generated code should not have any warnings in it. You should have an easy way to correct the generator the make the generated code without warnings. I really see no reason why generated code should trigger gcc warnings, even in -Wall mode! (It could mean that the generated C is not fully standard compliant C, nor GCC compilant C code).

And actually, that could help the generated code compiler (GCC or TCC in your case).

However, if you don't care about the performance of generated code:

first, don't invoke gcc with -O2, but just -O0 (or perhaps -O1).

consider some of the other alternatives (calling LLVM, libjit or GNU lightning; generating for tcc or nwcc or gcc -O0). There is also the possibility to generate for some bytecode interpreter (perhaps your own, or Parrot, or JVM, or OcamlVM, or CLI, or NekoVM)

BTW, did you consider coding the eC compiler in itself, or in some high level language like Ocaml?


Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

reply via email to

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