[jhc] [bug][jhc 7.7] about newIOArray: variable undeclared in the generated C source

John Meacham john at repetae.net
Tue Dec 6 12:34:17 CET 2011


Thanks for the report. Hmm... are you using the released tarball or
the version from the darcs repository?

which files did you need to change to get it to compile against 7.04?
I am still mainly on 6.12 but would like to have it compatible with
both.

    John


On Tue, Dec 6, 2011 at 11:15 AM,  <emacsray at gmail.com> wrote:
> On Tue, Dec 06, 2011 at 07:11:35PM +0000, emacsray at gmail.com wrote:
>> Hi all,
>>
>> The generated C source hs.out_code.c cannot be compiled due to
>> an undeclared variable. Here is the snippet code which can reproduce the
>> issue.
>>
>>
>> import Data.Array.IO
>> main = do
>>     arr <- newIOArray (0,42) 0 :: IO (IOArray Int Int)
>>     print 13
>>
>>
>> Here is the excerpt from jhc's output:
>>
>>
>> Writing "hs.out_code.c"
>> Running: gcc '-std=gnu99' -D_GNU_SOURCE '-falign-functions=4' -ffast-math -Wextra -Wall -Wno-unused-parameter -fno-strict-aliasing -o hs.out hs.out_code.c -DNDEBUG -O3 '-D_JHC_GC=_JHC_GC_JGC'
>> hs.out_code.c: In function ‘ftheMain’:
>> hs.out_code.c:1867:27: error: ‘v119549094’ undeclared (first use in this function)
>> hs.out_code.c:1867:27: note: each undeclared identifier is reported only once for each function it appears in
>> hs.out_code.c: In function ‘fx57580221’:
>> hs.out_code.c:1886:24: warning: comparison between signed and unsigned integer expressions
>> hs.out_code.c:1889:9: warning: statement with no effect
>> hs.out_code.c:1926:17: warning: statement with no effect
>> jhc: user error (C code did not compile.)
>>
>>
>> The whole session is enclosed as `typescript'.
>>
>>
>> Btw, jhc 7.7  cannnot be compiled on ghc 7.0.4 smoothly. I add `{-#
>> LANGUAGE TypeFamilies #-}' and `import Data.Generics hiding (empty)' to
>> get it compiled.
>>
>> --
>> Regards,
>> Ray
>> ----------------------------
>> site: http://maskray.tk
>> ----------------------------
>
> Sorry, I forgot to enclose the attachment.
>
> --
> Regards,
> Ray
> ----------------------------
> site: http://maskray.tk
> ----------------------------
>
> _______________________________________________
> jhc mailing list
> jhc at haskell.org
> http://www.haskell.org/mailman/listinfo/jhc
>



More information about the jhc mailing list