Doug Royer <Doug@royer.com> writes:
> I deleted the original post, but I think the issue was signed
> versus unsigned comparisons. I think he was saying the
> variable should be explicitly declared as 'signed int'
> (or signed char) and not 'int' (or char) because EOF is (-1).
>
> unsigned int foo;
>
> if (foo == -1) ... causes a warning (or errors)
> on many compilers.
>
> And if the default for int or char is unsigned as it can
> be on some systems, the code does exactly that.
>
> Perhaps he is just wanted to reduce the build time noise?
>
> Apologies if this was not on point.
The point is that this is potentially buggy code.
-Doug
--
Let us cross over the river, and rest under the shade of the trees. --T. J. Jackson, 1863