Representation Clauses

Karl Keyte KKEYTE at ESOC.BITNET
Mon Feb 18 22:35:39 AEST 1991


>>Actually, being able to specify a structure's element alignment
>>DOES guarantee portability.

>No, I stand by what I said.  While, using the technique you suggest,
>structure member alignment would be a NECESSARY condition for
>portability, it would not be SUFFICIENT.

You're pre-judging here.  You're making assumptions as to what kind of
data is being transferred.  For many applications, the alignment WOULD
be adequate.  It may be all bit-fields and integers.  If there's a risk
of byte ordering problems in integers, one single flag byte could be
used to identify the scheme adopted at the source end.

>>If you know you receive an IEEE standard FP number in a particular
>>element then you can convert as appropriate.

>This has not been my experience, and it certainly does not apply to
>multi-byte integral types.

The '>>' line is taken out of context!  Anyway, it's true!  If you transfer
data according to IEEE formats, there is NO possible ambiguity even in the
representation of integers - a standard is defined for that.

>>It's a shortfall of the standard as far as I'm concerned.

>You're entitled to your opinion about that.  I disagree.

Like I said, let's leave 'C' alone then.  I should re-direct the discussion
to the C++ forum, which is a language still undergoing evolution.

Karl



More information about the Comp.std.c mailing list