[bug][jhc 7.7] about newIOArray: variable undeclared in the generated C source
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 ----------------------------
On Tue, Dec 06, 2011 at 07:11:35PM +0000, emacsray@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 ----------------------------
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,
On Tue, Dec 06, 2011 at 07:11:35PM +0000, emacsray@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@haskell.org http://www.haskell.org/mailman/listinfo/jhc
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,
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@haskell.org http://www.haskell.org/mailman/listinfo/jhc
Hallo John, your announcement that jhc now can be built by GHC 7.0 started me to try the even newer GHC 7.2 and 7.4rc1. There seams some work to do, and for warming up I've tried to patch DrIFT for these GHC versions. I attach a patch for the darcs version of DrIFT. I have tested it both with GHC 7.2.2 and 7.4rc1, but not with older GHC versions since I currently only have 7.2.2 and 7.4rc1 installed. Hope that helps Dirk
Hi, I'd rather have DrIFT depend only on haskell98, that will give it
the widest range of compilers it will work on. as far as i know, it is
already pure haskell 98 so it should just need the right compile flag
on new versions of ghc.
I tend to mainly keep jhc compatible with what is in ubuntus stable
release, which is ghc 7.0.2 at the moment. though patches for newer
versions would be appreciated of course.
John
On Tue, Jan 17, 2012 at 1:27 PM, Dirk Ullrich
Hallo John,
your announcement that jhc now can be built by GHC 7.0 started me to try the even newer GHC 7.2 and 7.4rc1. There seams some work to do, and for warming up I've tried to patch DrIFT for these GHC versions. I attach a patch for the darcs version of DrIFT. I have tested it both with GHC 7.2.2 and 7.4rc1, but not with older GHC versions since I currently only have 7.2.2 and 7.4rc1 installed.
Hope that helps Dirk
participants (3)
-
Dirk Ullrich -
emacsray@gmail.com -
John Meacham