F
Flash Gordon
santosh wrote, On 07/08/08 06:26:
True. How it behaves on an implementation which raises a trap is just as
irrelevant to the point as how it behaves on a VAX or under MSVC (since
all the world is now MSVC instead of being a VAX).
Chuck, if you were going to pick up on the non-portable aspects in my
post you should also have picked up on me specifying:
2s complement
CHAR_BIT==16
EOF==-1
sizeof(int)==1
no padding bits in int
putc not failing
That an implementation could be defined as raising a signal on the
conversion is just as irrelevant as the fact that putc could fail or
that CHAR_BIT can be 8, 9 or 15. In such situations putc cannot return
the value of EOF and the discussion was about whether it is possible for
putc to return EOF on any implementation.
He never claimed that the code was portable. He was talking about a
particular case, a particular machine, that does define perfectly the
conversion of (unsigned char)EOF to an int, yielding EOF again.
True. How it behaves on an implementation which raises a trap is just as
irrelevant to the point as how it behaves on a VAX or under MSVC (since
all the world is now MSVC instead of being a VAX).
Chuck, if you were going to pick up on the non-portable aspects in my
post you should also have picked up on me specifying:
2s complement
CHAR_BIT==16
EOF==-1
sizeof(int)==1
no padding bits in int
putc not failing
That an implementation could be defined as raising a signal on the
conversion is just as irrelevant as the fact that putc could fail or
that CHAR_BIT can be 8, 9 or 15. In such situations putc cannot return
the value of EOF and the discussion was about whether it is possible for
putc to return EOF on any implementation.