chars in conditional expression, 3b2 C compiler
Doug Gwyn
gwyn at brl-smoke.ARPA
Tue Jan 6 04:00:13 AEST 1987
In article <189 at olamb.UUCP> kimcm at olamb.UUCP (Kim Chr. Madsen) writes:
-The only thing that really bugs me is the fact that chars are unsigned
-and therefore the following code will fail:
- while ((c=getc(stream)) != EOF) putchar(c);
-And you will have to redefine EOF to 255 (0377 or 0xff) or cast it to a char!
I suspect there will be a zillion follow-ups explaining
that getc() returns an (int), not a (char), and that EOF
should remain defined as -1. This has been hashed over
many times in net.lang.c. It is not a bug in the 3B2 C
implementation.
More information about the Comp.bugs.sys5
mailing list