Path: 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: Date: 3 Aug 90 08:17:45 GMT References: <56159@microsoft.UUCP> <56165@microsoft.UUCP> <6785@netxcom.DHL.COM> <6815@netxcom.DHL.COM> <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 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