invalid comparsion in 'src/input.c' line 516

michael becker michaelb@coconet.de
Wed, 19 Dec 2001 02:10:12 +0100 (MET)


	hi,

	i compiled 'Hugs Version: December 2001' on aix using
        the native aix-compiler. when i start hugs, hugs hangs when
	parsing Prelude.hs.

	this happens because on line 516 in 'src/input.c' an integer (EOF)
	is compared with a char

    512 static Int local nextLine()
    513 {
    514     for (lineLength = 0; lineLength < LINEBUFFER_SIZE-1; lineLength++) {
    515         lineBuffer[lineLength] = fgetc(inputStream);
    516         if (lineBuffer[lineLength] == EOF)


        when i changed this to

    512  static Int local nextLine()
    513  {
    514  int chr;
    515      for (lineLength = 0; lineLength < LINEBUFFER_SIZE-1; lineLength++) {
    516          lineBuffer[lineLength] = (chr = fgetc(inputStream));
    517          if (chr == EOF)


        hugs works ok.


	M.Becker