Newsgroups: comp.std.c++
Path: utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: "packed" objects
Message-ID: <1990Aug1.171148.22119@zoo.toronto.edu>
Organization: U of Toronto Zoology
References: <56159@microsoft.UUCP> <56165@microsoft.UUCP> <6785@netxcom.DHL.COM>
Date: Wed, 1 Aug 90 17:11:48 GMT

In article <6785@netxcom.DHL.COM> ewiles@netxcom.DHL.COM (Edwin Wiles) writes:
>	A) You would not be guaranteed that a data file written by a given
>	program on one machine, would be readable by the same program compiled
>	on a different machine under a different implementation of C++.

This is already the case, and is not likely to change.  The internal format
of structs/classes typically contains machine-specific padding, which isn't
always the same even between machines using the same processor (680x0 systems
differ!), never mind seriously-different machines.  There are also the small
issues of byte ordering, floating-point representation, ones-complement
integers, etc.  The "guarantee" that you are claiming has never existed.

>	B) Certain C++ languages (Lattice C++ for the Amiga for one) make
>	extensive use of C++ structures/classes to hide the cruft of working
>	with the system libraries.  Surely a desireable end.  However, the
>	system libraries depend on a specific order of elements within a
>	structure and would likely break under either of the above.

This just means that there have to be enough guarantees on behavior that
the library code can assume a stable base.  This is much the same as what
would be needed to make inheritance work anyway, so I don't see a problem
there in general.
-- 
The 486 is to a modern CPU as a Jules  | Henry Spencer at U of Toronto Zoology
Verne reprint is to a modern SF novel. |  henry@zoo.toronto.edu   utzoo!henry
