Article View: comp.sys.mac.programmer.codewarrior
Article #827Re: Alignment (padding) of derived classes, Mach-O vs. CFM
From: Thorrsten Froehlich
Date: Fri, 20 Jun 2003 18:41
Date: Fri, 20 Jun 2003 18:41
23 lines
2127 bytes
2127 bytes
stk@snafu.de (Stefan Haller) wrote in message news:<1fwuuqx.ngui9t15gtnejN%stk@snafu.de>...
> Ed Swartz <eswartz@antispam.metrowerks.com> wrote:
>
> > CFM is based off a 16-bit 68K
> > architecture, while Mach-O is based off a 32-bit PPC architecture, so there
> > are inherent unconfigurable differences in the ways the invisible parts of
> > the classes are aligned.
Actually, the poster of this is wrong regarding CFM using 2-byte
alignment on PowerPC. It of course has always used 4-byte alignment.
He is also wrong suggestioning to use pack(), see below.
> To sum it up: it seems that manually padding our classes to multiples of
> 8 bytes is our only option, right?
No, you may want to check out the "C Compilers Reference 3.0" in the
CodeWarrior manuals folder. In the PDF version, go to page 130. You
are looking for "#pragma options align", which is the appropriate way
to set alignment when compiling for PowerPC . You may also want to
take a look at the other options listed, there is a lot of useful
information there...
Thorsten
Technical Details
Message-ID:
<a1ed16f9.0306201041.466a7240@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailReferences:
<1fwrc5z.1wbucc58vha4aN%stk@snafu.de> <bctluk$kn0$1@newshost.mot.com> <1fwuuqx.ngui9t15gtnejN%stk@snafu.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10bcce,98e56c06675247cc X-Google-Attributes: gid10bcce,public X-Google-Thread: f635e,98e56c06675247cc X-Google-Attributes: gidf635e,public X-Google-ArrivalTime: 2003-06-20 11:41:32 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: froetho@charlie.iit.edu (Thorrsten Froehlich) Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac Subject: Re: Alignment (padding) of derived classes, Mach-O vs. CFM Date: 20 Jun 2003 11:41:31 -0700 Organization: http://groups.google.com/ Lines: 23 Message-ID: <a1ed16f9.0306201041.466a7240@posting.google.com> References: <1fwrc5z.1wbucc58vha4aN%stk@snafu.de> <bctluk$kn0$1@newshost.mot.com> <1fwuuqx.ngui9t15gtnejN%stk@snafu.de> NNTP-Posting-Host: 213.23.176.134 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1056134492 9934 127.0.0.1 (20 Jun 2003 18:41:32 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 20 Jun 2003 18:41:32 GMT