Mail Archives: djgpp/1996/04/03/01:06:26
Toru Suzuki <toru AT maelstrom DOT seos DOT uvic DOT ca> writes:
>I generated F2C.EXE from sources of version 19660301 using V2. It
>looks like working succecfuly, at least my simple programs.
>You need to change about fscanf() in format.c, i.e.
>from:
> if (fscanf (infile, "%d", &token) == EOF)
>to:
> if (fscanf (infile, "%d", &token) == NULL)
This should better be written like this:
if ((fscanf (infile, "%d", &token) < 1 ) && feof(infile))
(Just in case DJGPP will some time learn to return EOF, as it
should...)
>Because return value of fscanf() of V2 is different from UNIX.
Not only from UNIX, but from everything I ever found on the matter
(including K&R2, and P.J. Plauger's book about the ANSI standard library).
This is a (known) bug in DJGPP, and a fix is available (from me, if
you must, or) from DJ's bug tracking system on his WWW server.
Hans-Bernhard Broeker (Aachen, Germany)
- Raw text -