draft ANSI standard: one change that would *really* help Europe

S.J.Leviseur sjl at ukc.ac.uk
Thu Dec 4 22:04:29 AEST 1986


In article <8322 at lll-crg.ARpA> bandy at lll-crg.UUCP (Andrew Scott Beals) writes:
>In article <1382 at hoptoad.uucp> gnu at hoptoad.uucp (John Gilmore) writes:
>>[This is posted to comp.lang.c because mod.std.c seems to be dead.  Love
>>those mod groups!]
>
>>[We really need an 8-bit character set and C needs to acknowledge this]
>
>>[John thinks that perhaps "char" should be unsigned - most programs
>  would be more correct since they assUme that chars are unsigned]
>
>Well, I heartily agree, but I think that there must be some programs
>out there that assume that chars are useful as small signed numbers,
>which I would also prefer not to break.  

Actually this breaks *LOTS* of programs. We have a compiler with unsigned
chars on some of our machines. This causes endless problems with what is
'affectionately' known as the "EOF bug".

The implementors of that compiler said it was the first thing they would
alter if they reimplemented it because of the number of problems it caused.
If you want to see for yourself have a look through your sources and find
every occurence of a comparision between EOF or -1, and a char. Typically,
where cp is a character pointer:-

		if (*cp == EOF)
	or
		while (*cp != EOF)

Older code is littered with these constructs.

	sean



More information about the Comp.lang.c mailing list