new patch for nhc98-1.02



About this list Date view Thread view Subject view Author view

Malcolm Wallace (malcolm-nhc@cs.york.ac.uk)
Mon, 19 Feb 2001 13:39:15 +0000


Another new patch for nhc98-1.02 has just been published, and is attached to the end of this message. It also available from the nhc98 status web page: http://www.cs.york.ac.uk/fp/nhc98/status.html It fixes a bug whereby the function IO.openFile silently changed ReadMode and WriteMode arguments to ReadWriteMode internally. In particular, if you built the compiler with nhc98 or with gcc then installed it as root, the installed compiler could not be used on any normal user files - it complained about being unable to open the Prelude.hi or Ratio.hi standard interface files. This is due to the bug outlined above - the installed standard interface files have read-only permission for ordinary users, so an openFile fails. You can fix this behaviour by applying the patch to the sources and rebuilding just the runtime system 'make runtime'. Regards, Malcolm ----cut here---- diff -u nhc98-1.02/src/runtime/Builtin/cOpen.c nhc98-1.02x/src/runtime/Builtin/cOpen.c --- nhc98-1.02/src/runtime/Builtin/cOpen.c Thu Nov 23 14:04:18 2000 +++ nhc98-1.02x/src/runtime/Builtin/cOpen.c Mon Feb 19 12:15:27 2001 @@ -94,9 +94,9 @@ FILE *fp; switch (iom) { - case ReadMode: type = "r+"; break; - case WriteMode: type = "w+"; break; - case AppendMode: type = "a+"; break; + case ReadMode: type = "r"; break; + case WriteMode: type = "w"; break; + case AppendMode: type = "a"; break; case ReadWriteMode: type = "rw"; break; } /*fprintf(stderr,"fopen: attempting to open file %s for %s\n",filename,type);*/


About this list Date view Thread view Subject view Author view