Frederick Gotham said:
Keith Thompson posted:
I rarely check over my code before posting to Usenet, so you can expect
to see the odd error or oversight here and there. More to the point, why
shift the focus away from the topic at hand, impertinently focusing the
attention on a misplaced "const"? It makes the exchange less enjoyable.
If you make an error, expect to have it pointed out. If you make an
error because you didn't bother to check over your code before posting
it, expect to be flamed for wasting everybody's time.
[...]
Here's what I was getting at:
If the machine in question can only do floating-point arithmetic, and
if it achieves integral arithemic via usage of padding bits... then how
could it possibly do arithmetic on an unsigned char (because an unsigned
char is guaranteed to be absent of padding bits)?
I never said it can only do floating-point arithmetic. I think all I
said is that its design emphasizes floating-point performance over
integer performance. I actually don't know what it does on the
machine-code level, but the C implementation is, as far as I know,
conforming (C90, not C99). I think it does have instructions for
integer arithmetic.
The C compiler has CHAR_BIT==8, and it properly implements 8-bit
unsigned char with all the semantics required by the standard. It
probably goes through some extra gyrations to do this, but the details
are off-topic. The run-time behavior of the program you posted won't
illustrate anything in particular about the system. An assembly
listing might, but I'm not going to post one. If you're sufficiently
curious, you can get your own account at
www.cray-cyber.org.
Perhaps I just should have said that some real C implementations have
padding bits for some integer types and left it at that.