logo       

ghc fails "hello world" on ppc: msg#00001

lang.haskell.glasgow.bugs

Subject: ghc fails "hello world" on ppc

$ uname -a
Linux fly 2.4.19-quiet #10 Tue Jan 12 17:02:50 PST 1904 ppc GNU/Linux
$ cat > test.hs
main =
do
putStr "hello\n"
putStr "world\n"
$ ghc --make test.hs && ./a.out
Chasing modules from: test.hs
Compiling Main ( test.hs, ./test.o )
Linking ...
world
world

On my i386 machine it works correctly:

$ ghc --make test.hs && ./a.out
Chasing modules from: test.hs
Compiling Main ( test.hs, ./test.o )
Linking ...
hello
world

Various permutations of the original program produce the same result
on the ppc:
----------------------------------------------------------------
import System.IO
main =
do
hSetBuffering stdout NoBuffering
putStr "hello\n"
putStr "world\n"
----------------------------------------------------------------
import System.IO
main =
do
hSetBuffering stdout NoBuffering
putStrLn "hello"
putStrLn "world"
----------------------------------------------------------------
main =
do
putStrLn "hello"
putStrLn "world"
----------------------------------------------------------------
etc., except that anything with putStrLn prints
hello
hello
instead of
world
world


TIA.

Frederik Eaton


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise