🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #261

Re: objectives

#261
From: Roland McGrath
Date: Fri, 03 Aug 1990 08:17
20 lines
1921 bytes
In article <1990Aug2.165111.25529@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) 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 (with a couple of tiny
   and hard-to-avoid exceptions).  Many people think that this limited upward
   compatibility is a good idea and should not be sacrificed.  The name of
   the language is "C++", not "D".

I don't see how this would not remain true if member reordering were allowed.
The C compiler will generate accesses to the structure in the given order
throughout the program, so all the accesses will work.  The C++ compiler will
generate accesses to the structure in whatever order it deems appropriate,
using this single order throughout the program, so all the accesses will work.

You can't expect to interlink different pieces of a program that is both legal
C and legal C++, some of which are compiled in C, some in C++, anyway.  If you
could, `extern "C"' would not have been invented.
--
	Roland McGrath
	Free Software Foundation, Inc.
roland@ai.mit.edu, uunet!ai.mit.edu!roland
Technical Details
Message-ID: <MCGRATH.90Aug3011745@paris.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!uakari.primate.wisc.edu!sdd.hp.com!decwrl!ucbvax!pasteur!paris.Berkeley.EDU!mcgrath
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>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!uakari.primate.wisc.edu!sdd.hp.com!decwrl!ucbvax!pasteur!paris.Berkeley.EDU!mcgrath
From: mcgrath@paris.Berkeley.EDU (Roland McGrath)
Newsgroups: comp.std.c++
Subject: Re: objectives
Message-ID: <MCGRATH.90Aug3011745@paris.Berkeley.EDU>
Date: 3 Aug 90 08:17:45 GMT
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>
Sender: news@pasteur.Berkeley.EDU
Organization: Hackers Anonymous International, Ltd., Inc. (Applications
 welcome)
Lines: 20
In-reply-to: henry@zoo.toronto.edu's message of 2 Aug 90 16:51:11 GMT