Modified proposal for default decls

Alastair Reid reid at cs.utah.edu
Mon Feb 26 12:11:13 EST 2001


> Many C interfaces contain a significant number of macros.  And C is
> one of the most widely used languages that we want to interface with.
> So it seems to me that any FFI which aims to provide *good* support for
> C ought to provide a way of accessing C macros.

Since an explicit goal of the original ffi design was that it would not require
a C compiler to implement it and since at least one implementation (STG-Hugs)
doesn't require a C compiler, I'd like to see a lot of discussion before we add
support for macros to the ffi.

Alastair


ps

> However, the vast majority of C compilers
> don't store the necessary type info.

Since it's non-portable, it has no real bearing on this discussion but,
nevertheless, people on this list might like to try compiling a C file with -g
and then using 'objdump --debugging' to view the debugging information it
contains.  Besides variable and function types, it lists lots of typedefs and
fields in struct declarations are annotated with the bit size and offset of the
field.





More information about the FFI mailing list