public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joe Buck <Joe.Buck@synopsys.COM>
To: Nathan Sidwell <nathan@codesourcery.com>
Cc: Chris Lattner <sabre@nondot.org>,
	Tiago Stein <tiago@lisha.ufsc.br>,
	gcc@gcc.gnu.org
Subject: Re: Double abstract class Inheritance concern.
Date: Mon, 29 Mar 2004 18:49:00 -0000	[thread overview]
Message-ID: <20040329084751.A32489@synopsys.com> (raw)
In-Reply-To: <4067D6DD.1060607@codesourcery.com>; from nathan@codesourcery.com on Mon, Mar 29, 2004 at 08:57:17AM +0100


Chris Lattner wrote:
> > I believe the reason is that the ABI does not permit multiple different
> > instances of A to be located at the same address, even if they have zero
> > size.  If the size of the structure was 8, all of "A", "B", and "A" would
> > have offset zero.
> > 
> > I'm not sure WHY this is required, but this is the reason it happens at
> > least.  A declaration of "A X[100];" allocates 100 bytes as
> > a result of the same rule.

On Mon, Mar 29, 2004 at 08:57:17AM +0100, Nathan Sidwell wrote:
> It is a C++ language requirement that no two logically distinct objects
> of the same type have the same address.

However, g++ still finds plenty of opportunities to allocate zero bytes
for a struct/class object, when it is not adjacent to any other objects of the
same type (e.g. an empty base class, or an empty data member of a struct
or class).


  reply	other threads:[~2004-03-29 16:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-29 14:03 Chris Lattner
2004-03-29 17:16 ` Nathan Sidwell
2004-03-29 18:49   ` Joe Buck [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-03-29 13:57 Tiago Stein
2004-03-29 15:15 ` Alexandre Oliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040329084751.A32489@synopsys.com \
    --to=joe.buck@synopsys.com \
    --cc=gcc@gcc.gnu.org \
    --cc=nathan@codesourcery.com \
    --cc=sabre@nondot.org \
    --cc=tiago@lisha.ufsc.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).