GNU Pascal Homepage - gpc - gpc-announce - gpc-de - gpc-doc
This page in English

Mail #11285 (Unformatiert/Volle Header)

Zurück zur Archiv-Hauptseite

Vorige Mail   Nächste Mail   Formatiert
Übersicht  10 Tage   Betreff   Datum   Thread   Autor  

From gpc-owner@gnu.de  Thu Jan 27 08:27:52 2005
Received: from mail.ncifcrf.gov ([129.43.100.101])
	by adele.gerwinski.de with esmtp (Exim 4.34)
	id 1Cu449-00086o-6i
	for gpc@gnu.de; Thu, 27 Jan 2005 08:27:45 +0100
Received: from mail.NCIFCRF.GOV(129.43.100.101) by AVAS3.ncifcrf.gov via smtp
	 id 16d2_9c797ffe_7034_11d9_85bc_0002b3c7efef;
	Thu, 27 Jan 2005 02:25:25 -0500 (EST)
Received: from strawberry.ncifcrf.gov (strawberry.NCIFCRF.GOV [129.43.6.74])
	by mail.ncifcrf.gov (8.12.10/8.12.10) with ESMTP id j0R7Qjd0027496
	for <gpc@gnu.de>; Thu, 27 Jan 2005 02:26:45 -0500
Received: (from toms@localhost)
	by strawberry.ncifcrf.gov (8.12.10+Sun/8.12.10/Submit) id j0R7QjHn008733
	for gpc@gnu.de; Thu, 27 Jan 2005 02:26:45 -0500 (EST)
Date: Thu, 27 Jan 2005 02:26:45 -0500 (EST)
From: Tom Schneider <toms@ncifcrf.gov>
Message-Id: <200501270726.j0R7QjHn008733@strawberry.ncifcrf.gov>
To: gpc@gnu.de
Subject: EOF is not true on reset empty file
X-Archive-Number: 200501/67
X-Sequence-Number: 4997

One of my programs, which I have used with many compilers in the past,
started an odd behavior as soon as I compiled with GPC.  I rooted down
to what the cause was and found this:

EOF is not true on a reset empty file.

Here is the program:

********************************************************************************
program gpcbug2005jan27(namebook, namelist, output);
(* 
  Dr. Thomas D. Schneider
  National Cancer Institute
  Laboratory of Experimental and Computational Biology
  Molecular Information Theory Group
  Frederick, Maryland  21702-1201
  toms@ncifcrf.gov
  permanent email: toms@alum.mit.edu (use only if first address fails)
  http://www.lecb.ncifcrf.gov/~toms/
*)
const
version = 1.00; (* of gpcbug2005jan27.p 2005 jan 27 *)

var
   namebook, namelist: text;

begin
  reset(namebook);
  if eof(namebook)
  then writeln(output,'eof of namebook')
  else writeln(output,'NOT eof of namebook');

  reset(namelist);
  if eof(namelist)
  then writeln(output,'eof of namelist')
  else writeln(output,'NOT eof of namelist');
end.
********************************************************************************

This is the result of running a script called mk (which displays itself):

********************************************************************************
version = 1.00 of mk 2005 Jan 27
#!/bin/tcsh -f
#(ie run the tshell on this but don't read the .cshrc or .tcshrc)

echo version = 1.00 of mk 2005 Jan 27
# 2005 Jan 27, 1.00: origin 

# show the script that does everything:
cat mk

echo -n "" > namebook
echo -n "" > namelist

echo 'file name*'
file name*

echo
echo 'wc -l name*'
wc -l name*

echo
echo 'ls -l name*'
ls -l name*

echo -------------------- compile
gpcc gpcbug2005jan27.p
echo --------------------

gpcbug2005jan27
file name*
namebook:       empty file
namelist:       empty file

wc -l name*
       0 namebook
       0 namelist
       0 total

ls -l name*
-rw-------   1 toms     delila         0 Jan 27 02:25 namebook
-rw-------   1 toms     delila         0 Jan 27 02:25 namelist
-------------------- compile
version = 1.37 of gpcc 2004 Jan 11
Using /usr/local/gpc/bin/gpc instead of the one in the path
gpc compiling gpcbug2005jan27.p
output program name: gpcbug2005jan27
gpcbug2005jan27.p exists, so we can delete gpcbug2005jan27: REMOVING gpcbug2005jan27
version = 1.00; (* of gpcbug2005jan27.p 2005 jan 27 *)
optimization:  0
---
GPC version from "gpc --version | head -1" :
gpc 20040516, based on gcc-3.3.3
GPC version from "gpc | head -1" :
GNU Pascal version 20040516, based on gcc-3.3.3.
---
ONLY STANDARD PASCAL IS ALLOWED

------
No errors
------
No warnings
------

gpcc is done
--------------------
NOT eof of namebook
NOT eof of namelist
********************************************************************************

Is this standard behavior for Pascal?  I thought that if you reset
an file, it would be at eof.  Where else could it be?

Tom

  Dr. Thomas D. Schneider
  National Cancer Institute
  Laboratory of Experimental and Computational Biology
  Molecular Information Theory Group
  Frederick, Maryland  21702-1201
  toms@ncifcrf.gov
  permanent email: toms@alum.mit.edu (use only if first address fails)
  http://www.lecb.ncifcrf.gov/~toms/

Vorige Mail   Nächste Mail   Formatiert
Übersicht  10 Tage   Betreff   Datum   Thread   Autor  


Antworten auf diese Mail

Autor Betreff Datum
Waldek Hebisch EOF is not true on reset empty file 29.1.2005, 14:14:18
Waldek Hebisch EOF is not true on reset empty file 30.1.2005, 02:05:50

Zurück zur Archiv-Hauptseite


Hinweis: Diese Seite enthält Informationen, die nicht vom Betreiber dieser Website, sondern von den Autoren der archivierten Mails stammen. Der Betreiber dieser Website ist nicht für den Inhalt dieser Informationen verantwortlich. Die weitere Verwendung dieser Informationen bedarf des Einverständnisses des jeweiligen Autors.

Sofern WWW-Adressen (URLs) in den archivierten Mails als Hyperlinks hervorgehoben werden, so geschieht dies ausschließlich zur Annehmlichkeit für den Leser. Der Inhalt der auf diese Weise angelinkten Webseiten spiegelt nicht notwendigerweise die Meinung des Betreibers dieser Webseite oder der Autoren der archivierten Mails wider. Der Betreiber dieser Webseite ist nicht für den Inhalt solcher Webseiten verantwortlich. Diese Seiten sind ausdrücklich nicht als Teil des Inhalts dieser Seite zu betrachten, sondern lediglich als Referenzen.


Diese Seite wurde erzeugt von Crystal 0.999 (Linux 2.4.27/i686).