www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/03/01:06:26

Xref: news2.mv.net comp.os.msdos.djgpp:2386
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Installing DJGPP on network
Message-ID: <Broeker.828358102@axp03>
From: Broeker AT axp03 DOT physik DOT rwth-aachen DOT de (Hans-Bernhard Broeker)
Date: 1 Apr 96 11:28:22 GMT
References: <199603302010 DOT PAA03030 AT delorie DOT com>
Organization: RWTH -Aachen / Rechnerbetrieb Informatik
NNTP-Posting-Host: axp03.physik.rwth-aachen.de
Lines: 26
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019