public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Geoff Keating <geoffk@geoffk.org>
To: xinant@cognigine.com
Cc: ian@zembu.com, binutils@sources.redhat.com
Subject: Re: "lang_statement_union_type and its usage?"
Date: Thu, 31 May 2001 13:56:00 -0000	[thread overview]
Message-ID: <200105312055.NAA19463@geoffk.org> (raw)
In-Reply-To: <3B16ADDC.80700@cognigine.com>

> Date: Thu, 31 May 2001 13:47:24 -0700
> From: xinant@cognigine.com (Xinan Tang)

> > 
> > All elements of lang_statement_union start with
> >   lang_statement_header_type header;
> > The first field in lang_statement_header_type is
> >   union lang_statement_union *next;
> > 
> > Therefore, in all cases, the first field in any instance of
> > lang_statement_union will be the next pointer.
> > 
> > This is a pretty common hack when implementing derived classes in C.
> > 
> > Ian
> 
>    I see. However, this may not work if some optimizing compilers
> would change the relative order of the `next' field. I.e., this scheme
> is compiler-dependent.

I believe that the C standard promises that this works.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

  reply	other threads:[~2001-05-31 13:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-31 11:57 Xinan Tang
2001-05-31 12:11 ` Ian Lance Taylor
2001-05-31 13:47   ` Xinan Tang
2001-05-31 13:56     ` Geoff Keating [this message]
2001-05-31 14:10     ` Ian Lance Taylor

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=200105312055.NAA19463@geoffk.org \
    --to=geoffk@geoffk.org \
    --cc=binutils@sources.redhat.com \
    --cc=ian@zembu.com \
    --cc=xinant@cognigine.com \
    /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).