Re:Abusing the C Compiler
by JoeAltmaier on Wednesday September 08, 2010 @02:39PM
(#1672908)
Unless you're compiling for another platform, or a different code model than the default etc.
[ Parent
| on HN ]
Re:Abusing the C Compiler
by koenigdavidmj on Wednesday September 08, 2010 @03:41PM
(#1673163)
In the first case, you are likely going to have a libc and headers from the target platform sitting around so that you can link.
Re:Abusing the C Compiler
by JoeAltmaier on Wednesday September 08, 2010 @03:55PM
(#1673235)
May take switches on the compiler command line.
Further, packing can depend upon the pragma in force when the header file is included. How to set up that environment?
You know, the whole dynamic FFI world is very much seatbelts-off, which is initially quite disconcerting. Usually I rely on my distro to ensure compatibility, but once you start saying "this syscall gives me a pointer to memory which should be interpreted as two ints, one char, and a float, packed conventionally" you begin to realize what exactly are the interfaces between various bits on your system. For better and for worse of course.
What Guile has now is the "list-all-members-in-the-struct" approach that Klock discourages. It's the difference between API and ABI compatibility. I'd like to figure out how to do the former.
A