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

John Meacham john at repetae.net
Tue Jan 17 10:01:58 CET 2012


Ah, finally had time to track down and fix this. It will be fixed in
the next jhc release. thanks for the report!

    John

On Tue, Dec 6, 2011 at 11:11 AM,  <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
> ----------------------------
>
> _______________________________________________
> jhc mailing list
> jhc at haskell.org
> http://www.haskell.org/mailman/listinfo/jhc



More information about the jhc mailing list