public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: kaih@khms.westfalen.de (Kai Henningsen)
To: gcc@gcc.gnu.org
Subject: Re: invalid offsetof from non-POD type
Date: Tue, 22 Apr 2003 10:09:00 -0000	[thread overview]
Message-ID: <8kMox$yXw-B@khms.westfalen.de> (raw)
In-Reply-To: <m3u1cr6xgo.fsf@uniton.integrable-solutions.net>

gdr@integrable-solutions.net (Gabriel Dos Reis)  wrote on 22.04.03 in <m3u1cr6xgo.fsf@uniton.integrable-solutions.net>:

> Zack Weinberg <zack@codesourcery.com> writes:
>
> | Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
> |
> | > John Quigley <johnw@lowestplane.org> writes:
> | >
> | > | While it is not standards compliant code, gcc still provides the
> | > correct | result.
> | >
> | > The key issue is what do you define to be the "correct" result when you
> | > apply offsetof() to a non-POD?
> |
> | I have never really understood why the C++ standard imposes this
> | restriction.  There would seem to be a well-defined answer to the
> | question posed by offsetof(non-POD, data-member), since the data
> | member does exist in memory at a well-defined offset from the
> | beginning of the object.  If that weren't true the compiler wouldn't
> | be able to generate accesses to it.
>
> That statement is confused.

Not really. You might quibble over details, but I completely agree with  
the basic content.

> The issue isn't that the compiler couldn't return some random number.

Nobody is asking for some random number. The number asked for is well- 
defined for the cases in which one typically asks for it, as far as I can  
see.

MfG Kai

  reply	other threads:[~2003-04-22  6:52 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-21 13:49 John Quigley
2003-04-21 14:30 ` Gabriel Dos Reis
2003-04-22  2:40   ` John Quigley
2003-04-22  3:14     ` Gabriel Dos Reis
2003-04-22  4:49       ` Zack Weinberg
2003-04-22  6:32         ` Gabriel Dos Reis
2003-04-22 10:09           ` Kai Henningsen [this message]
2003-04-22 10:34             ` Gabriel Dos Reis
2003-04-22 10:50               ` Nathan Sidwell
2003-04-22 10:59                 ` Gabriel Dos Reis
2003-04-22 18:19                   ` Zack Weinberg
2003-04-22 19:35                     ` Joe Buck
2003-04-22 11:07                 ` Gabriel Dos Reis
2003-04-22 18:46                   ` Joe Buck
2003-04-22 18:37           ` Joe Buck
2003-04-22 19:24             ` Daniel Jacobowitz
2003-04-22 19:39               ` Joe Buck
2003-04-23  7:38               ` Gabriel Dos Reis
2003-04-23  7:42                 ` Gareth Pearce
2003-04-22  7:06       ` John Quigley
2003-04-22  8:51         ` Gabriel Dos Reis
2003-04-25  8:07           ` John Quigley
2003-04-25 12:14             ` Nathan Sidwell
2003-04-25 12:29               ` Gareth Pearce
2003-04-25 15:13               ` Paul Koning
2003-04-25 23:30             ` Matthias Benkmann
2003-04-26 14:42               ` Nathan Sidwell
2003-04-27 15:43                 ` Matthias Benkmann
2003-04-28 18:59                   ` Matt Austern
2003-04-21 14:50 ` Nathan Sidwell
  -- strict thread matches above, loose matches on Subject: below --
2003-09-12  4:32 Arnold Cole
2003-09-12  4:55 ` Gabriel Dos Reis
2003-08-12 13:38 skaller
2003-08-12 14:36 ` Fergus Henderson
2003-08-12 22:05   ` skaller
2003-08-13 20:59     ` Matt Austern
2003-08-14  8:20       ` skaller
2003-01-10  7:28 Chris Croswhite

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='8kMox$yXw-B@khms.westfalen.de' \
    --to=kaih@khms.westfalen.de \
    --cc=gcc@gcc.gnu.org \
    /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).