$ cat > foo.c
#include <stdio.h>

int
main()
{
  char s[1024];
  printf("gsi> ");
  gets(s);
  printf("%s\n", s);
  return 0;
}
$ make foo
cc     gsi.c   -o gsi
$ ./foo
warning: this program uses gets(), which is unsafe.
gsi> hello
hello
$ cat > foo.hs
main = do
  putStr "gsi> "
  s <- getLine
  putStrLn s
$ ghc foo.hs -o foo
$ ./foo
hello
gsi> hello

(This is on MacOS X). It strikes me that GHC is being extraordinarily unhelpful here. Is there anyone on the planet who ever actually wants this behavior?

jcc

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to