|   Anybody knows how to generate a portable C code through GHC ?

It depends what you mean by portable.

GHC can produce C code which you can compile with gcc, without
special support -- we call this "unregisterised" code.  This code
needs some GNU extensions -- named initialisers, zero length arrays
and (I think) support for 64-bit arithmetic.  So it is not strict
ANSI C89 code, although it looks all 3 extensions will be the 
ANSI C9X standard.

I also believe (not sure, tho) that you'd still need to configure
GHC's runtime for word size (32 vs 64 bits) and endiannness, although
that isn't a problem.

So it's possible, but a bit tricky.  This is how GHC is ported
to new platforms.

What is it you want to achieve?  If you tell us this, we might
be able to be more specific.

J

Reply via email to