Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site dg_rtp.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!mcnc!rti-sel!dg_rtp!throopw From: throopw@dg_rtp.UUCP (Wayne Throop) Newsgroups: net.lang.c,net.micro.att Subject: Re: Why doesn't this work? (3B2 problem) Message-ID: <252@dg_rtp.UUCP> Date: Sat, 29-Mar-86 16:20:06 EST Article-I.D.: dg_rtp.252 Posted: Sat Mar 29 16:20:06 1986 Date-Received: Tue, 1-Apr-86 07:22:20 EST References: <276@birtch.UUCP> <2022@brl-smoke.ARPA> Lines: 26 Xref: watmath net.lang.c:8322 net.micro.att:1046 > getchar() returns an (int), not a (char). EOF is an (int). > You're throwing away some of the bits returned by getchar(), > [...etc,etc...] > Didn't "lint" catch this? What, you didn't try it? Why not? :-) Anyhow, feeding this #include void main(){ char c; while( (c = getchar()) != EOF ) ; } to SysV lint gives warning: nonportable character comparison Myself, I'd druther see lint complain whenever the types fed to an assignment don't match exactly, rather than allow "implicit casts", but the fact that quoted characters are of type int kind of spoils this idea for C, I suspect. -- Wayne Throop at Data General, RTP, NC !mcnc!rti-sel!dg_rtp!throopw