But more fundamental, how does it *hurt* to know what it is?
Humans are very bad at distinguishing between "things that I know happened
to be true once" and "things that I know to be true by definition" when they
are thinking about something else.
How would it hurt you to know the exact non-zero value your FORTRAN compiler
produces for .TRUE. when working with C?
#define IS_TRUE(x) ((x) == 0x100)
This actual code occurred in a large code base. They upgraded their FORTRAN
compiler and suddenly the C++ that interacted with it blew up, misidentifying
true things as false. I happened to look at the code and saw:
do_the_real_work(foo, bar, IS_TRUE(baz));
and told them "take out the IS_TRUE, it'll work". I later got to see the
definition.
Basically, someone who knows that EOF is "-1" rather than "some unspecified
negative value" is like to also know that things are twos complement and end
up writing something that does:
x = x & c;
because they *know* that, if c is EOF, it'll be a no-op.
Someone who doesn't know what EOF is will say "what happens if you and
something with EOF, which isn't a meaningful value?"
True story: I do not know what value EOF has on the systems I use
regularly. No clue. I mean, obviously it's negative. No clue past that.
I've never looked, I've never written code that cared, heck, I don't think
I've even used any test other than ==/!= EOF on a value that I suspected of
being EOF.
-s