Keith Thompson wrote On 04/04/07 20:09,:
Certainly not. It hurts my brain. Hurting my brain is not all right.
But to answer the question you *meant* to ask, I don't think C99 7.1.3
"Reserved identifiers" either forbid this or makes it undefined
behavior.
It does say:
Each macro name in any of the following subclauses (including the
future library directions) is reserved for use as specified if any
of its associated headers is included; unless explicitly stated
otherwise (see 7.1.4).
The "explicitly stated otherwise" clause doesn't apply to EOF.
I'm not 100% sure what "reserved for use as specified" means.
I think it means "the program is not all right."
It includes <stdio.h>, which defines the macro EOF, so
EOF cannot be used as an identifier for anything else.
No, not even if #undef'ed; the compiler is allowed to
behave "magically" w.r.t. reserved identifiers.
It is permissible to #undef a "masking macro" to
ensure making a call to an actual library function (7.1.4/1).
However, EOF is not such a macro, so I don't think #undef'ing
it is permitted.
... and it makes my brain hurt too, Mister Gumby.