Newsgroups: comp.std.c++
Path: utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: objectives
Message-ID: <1990Aug3.171232.27910@zoo.toronto.edu>
Organization: U of Toronto Zoology
References: <56159@microsoft.UUCP> <56165@microsoft.UUCP> <6785@netxcom.DHL.COM> <JEREMY.90Aug1084311@chook.ua.oz.au> <6815@netxcom.DHL.COM> <MCGRATH.90Aug1225852@paris.Berkeley.EDU> <1990Aug2.165111.25529@zoo.toronto.edu> <MCGRATH.90Aug3011745@paris.Berkeley.EDU>
Date: Fri, 3 Aug 90 17:12:32 GMT

In article <MCGRATH.90Aug3011745@paris.Berkeley.EDU> mcgrath@paris.Berkeley.EDU (Roland McGrath) writes:
>   It is currently a defined property of C++ (see E&S) that any program which
>   is both legal C and legal C++ means the same in both...
>
>I don't see how this would not remain true if member reordering were allowed.

The problem is that in C, the ordering is a documented property of the
language *and programs are therefore allowed to depend on it*.  For
example, it is explicitly guaranteed that a pointer to a later member
compares high against a pointer to an earlier one, and there are probably
programs out there somewhere that need this.  Such a program will break,
despite being legal C, if compiled with a reordering C++ compiler.
-- 
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
