ffi conformance of ghc 5.02
Alastair Reid
reid at reid-consulting-uk.ltd.uk
Thu Jul 4 20:01:49 EDT 2002
I finally found time to explore how to try the HGL with GHC on Windows.
After fixing some problems brought about by GHC no longer providing
to/fromInt (was it really necessary to remove them?) and fixing some
errors that Hugs' module system didn't catch, I was able to verify
that the HGL does not work with ghc 5.02.
Exploring the idea that the problem might be some bugs in GreenCard
which have been fixed recently, I tried compiling an up to date
version of the Win32 library - which brings me to my reports of
apparent non-conformance of GHC to the ffi (release candidate 4) spec.
1) GHC 5.02 seems to object to the unsafe keyword in this line:
foreign import ccall unsafe "Win32Types_stub_ffi.h prim_unmarshall_lpctstr_" prim_unmarshall_lpctstr_ :: Addr -> IO (Addr)
2) Removing all such uses of 'unsafe', I find that GHC objects that
"Win32Types_stub_ffi.h prim_nullHANDLE" is not a valid C identifier
in this code:
foreign import ccall unsafe "Win32Types_stub_ffi.h prim_nullHANDLE" prim_nullHANDLE :: IO (Addr)
It's certainly true that "Win32Types_stub_ffi.h prim_nullHANDLE" is
not a valid C identifier but prim_nullHANDLE is and that's what GHC
should be testing.
Anticipating that the response will be "these are fixed in the next
release", could I ask how I can get hold of a suitably fixed release
(without having to enter the GHC bootstrapping swamp) so that I can
make some progress. (It'd be fine to point me at a tarfile or
whatever via private email.)
[btw When did the ghc release deadline get moved back to? My personal
deadline for making progress on this is Wednesday because I'll be busy
in the US from my machine from 12th-29th July.]
--
Alastair
More information about the Glasgow-haskell-bugs
mailing list