-fvia-c -O generates mal-typed C code (casts double via
unsigned int)
Duncan Coutts
duncan.coutts at worcester.oxford.ac.uk
Sat Aug 7 13:59:45 EDT 2004
On Sat, 2004-08-07 at 18:52, Duncan Coutts wrote:
> Attached is a small collection of modules which exhibit the problem.
> If I make the test case much smaller, the problem goes away. It's not
> too complicated code though. Some imports were hacked around and a few
> bits commented out to get it out of a larger library. The test program
> sends (-1) :: Double to C land and back and gets something rather
> different back.
Sorry, should have said:
This is with ghc 6.2.1, same problem with my 6.3 cvs from about a month
ago.
If you want to run this program you need to link with a few things:
ghc -ffi -O --make Test.hs -o test '-#include <glib-object.h>'
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lgobject-2.0
-lglib-2.0
This is on Linux with glib-2.0 installed (it's part of gtk/gnome).
Duncan
More information about the Glasgow-haskell-bugs
mailing list