Address of array
rbj%icst-cmr at smoke.UUCP
rbj%icst-cmr at smoke.UUCP
Sat Apr 5 08:54:25 AEST 1986
> Structure and array assignment, and comparison for equality, without buffer
> copies is a good thing.
You are aware, of course, that comparison for equality of structures,
assuming it were added to the language, could not be implemented by a
"string compare" instruction or code sequence? Such a sequence would
compare the padding bytes between structure members; there is no
guarantee that those bytes are ever initialized, so two structures
whose values are equal may not contain identical bit patterns.
--
Guy Harris
{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
guy at sun.arpa (yes, really)
Fisrt, I disagree that struxure (or array) assignments are A Good Thing.
I much prefer the model of limiting primitive data types to values that
can be held in a register on an idealized machine. So much for the
`religious' part.
Secondly, struxures could be created with the padding bytes set to
all zero bits. Then, any garbage appearing in them could only be
creating by sloppy coding practices which even *I* abhor, even
considering my widely known nonportable tendencys.
(Root Boy) Jim Cottrell <rbj at cmr>
More information about the Comp.lang.c
mailing list