🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: "packed" objects (Oops! Forgot something!)

#230
From: Roland McGrath
Date: Thu, 02 Aug 1990 06:14
30 lines
1942 bytes
In article <MEISSNER.90Aug1191316@osf.osf.org> meissner@osf.org (Michael Meissner) writes:

   Hmm, don't you care about compatibility with things like system calls?
   I imagine the grief people would get if the stat structure got
   rearranged because some OS jock added a byte field at the end of the
   structure?  Yes, extern "C" can be used, but it just means that there
   are even more things to worry about getting right.

If you don't declare the `stat' function inside `extern "C"', it won't
necessarily work right anyway.  Using:

extern "C"
{
#include <sys/stat.h>
}

seems entirely reasonable to me.

   Also, it would seem to me that reordering things across class
   boundaries is a really bad idea -- then subclassing and virtual
   functions would have no chance of working.

If it is not feasible to reorder members across class boundaries and still do
subclassing and virtual functions right then noone will try to do it in their
implementation.  That doesn't mean the standard should prevent people from
trying if they want to.
--
	Roland McGrath
	Free Software Foundation, Inc.
roland@ai.mit.edu, uunet!ai.mit.edu!roland
Technical Details
Message-ID: <MCGRATH.90Aug1231443@paris.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!paris.Berkeley.EDU!mcgrath
References: <56159@microsoft.UUCP> <56165@microsoft.UUCP> <6785@netxcom.DHL.COM> <6786@netxcom.DHL.COM> <GSTEIN.90Jul31194438@goober.oracle.com> <MCGRATH.90Aug1122802@helen.Berkeley.EDU> <MEISSNER.90Aug1191316@osf.osf.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!paris.Berkeley.EDU!mcgrath
From: mcgrath@paris.Berkeley.EDU (Roland McGrath)
Newsgroups: comp.std.c++
Subject: Re: "packed" objects (Oops! Forgot something!)
Message-ID: <MCGRATH.90Aug1231443@paris.Berkeley.EDU>
Date: 2 Aug 90 06:14:43 GMT
References: <56159@microsoft.UUCP> <56165@microsoft.UUCP>
 <6785@netxcom.DHL.COM> <6786@netxcom.DHL.COM>
 <GSTEIN.90Jul31194438@goober.oracle.com>
 <MCGRATH.90Aug1122802@helen.Berkeley.EDU>
 <MEISSNER.90Aug1191316@osf.osf.org>
Sender: news@pasteur.Berkeley.EDU
Organization: Hackers Anonymous International, Ltd., Inc. (Applications
 welcome)
Lines: 30
In-reply-to: meissner@osf.org's message of 1 Aug 90 23:13:16 GMT