This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Objective C and STRUCTURE_SIZE_BOUNDARY
- To: Philip Blundell <pb at nexus dot co dot uk>
- Subject: Re: Objective C and STRUCTURE_SIZE_BOUNDARY
- From: Ovidiu Predescu <ovidiu at cup dot hp dot com>
- Date: Fri, 28 May 1999 10:04:23 -0700
- Cc: Nick Clifton <nickc at cygnus dot com>, egcs at egcs dot cygnus dot com
On Fri, 28 May 1999 17:45:17 +0100, Philip Blundell <pb@nexus.co.uk> wrote:
> >with the same structure boundary size? How this works? Is there a way to find
> >out at runtime what was the option passed to the compiler at the build time?
>
> No. What I was thinking we could do to fix this was introduce a new constant,
> call it MAX_STRUCTURE_SIZE_BOUNDARY, that is set to the upper bound you can
> have on STRUCTURE_SIZE_BOUNDARY. I think this should cause Objective C to
> always use the more cautious alignment (ie align to 32-bit boundaries) which
> will work regardless of what user code is doing.
I'm not sure I understand your statement. The Objective-C runtime library uses
that value to determine how to dynamically access structure members. If such a
structure is part of another structure then depending on the compiler option,
the ObjC runtime could try to access it aligned at either 8 or 32 bits. If we
use a 32-bit boundary, we could be wrong when the user code is compiled with a
8-bit boundary.
Ovidiu