Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC840302); site mcvax.UUCP Path: utzoo!watmath!clyde!burl!hou3c!hocda!houxm!houxz!vax135!cornell!uw-beaver!tektronix!hplabs!sdcrdcf!sdcsvax!dcdwest!ittvax!decvax!mcvax!guido From: guido@mcvax.UUCP Newsgroups: net.unix-wizards Subject: Re: Re: getc() != EOF; -1 byte in file Message-ID: <5836@mcvax.UUCP> Date: Fri, 15-Jun-84 01:38:16 EDT Article-I.D.: mcvax.5836 Posted: Fri Jun 15 01:38:16 1984 Date-Received: Wed, 13-Jun-84 01:41:49 EDT References: <223@ism780.UUCP> Organization: "Stamp Out BASIC" Committee, CWI, Amsterdam Lines: 20 [This discussion is getting silly. Trying to stamp out one more misundelstanding...] Someone suggests that a -1 byte in the file can be promoted to EOF. No it can't, for the simple reason that getc() is defined as returning an *int* in the range 0..255. My v7 manual doesn't state this, but just have a short look at the definition of getc() in /usr/include/stdio.h! Surely this was intended; the designers of the package were very well aware of what they were doing: the do warn that the value EOF (-1) returned by getw() [did you know that it existed?! ever used it?] can be a perfectly valid integer. Of course, when assigned to a signed char variable, the values in the range 128..255 become negative; but only then. -- Guido van Rossum, "Stamp Out BASIC" Committee, CWI, Amsterdam guido @ mcvax