mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Alan Shutko <ats@acm.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: sizeof problem in kernel modules
Date: 25 Jun 2001 17:07:09 +0200	[thread overview]
Message-ID: <jeofrc38f6.fsf@sykes.suse.de> (raw)
In-Reply-To: <Pine.LNX.3.95.1010625072259.5434A-100000@chaos.analogic.com> <87ofrcbryf.fsf@wesley.springies.com> <87g0cobrgz.fsf@wesley.springies.com>
In-Reply-To: <87g0cobrgz.fsf@wesley.springies.com> (Alan Shutko's message of "Mon, 25 Jun 2001 09:59:32 -0400")

Alan Shutko <ats@acm.org> writes:

|> Alan Shutko <ats@acm.org> writes:
|> 
|> > You can look at other things too... you can memcpy structures, pass
|> > them into functions, call sizeof, put them in arrays... it _is_ a
|> > physical representation.
|> 
|> One more tidbit: ISO/IEC 9899:1990 3.14
|> 
|>   3.14 object: A region of data storage in the execution environment,
|>     the contents of which can represent values.  Except for
|>     bit-fields, objects are composed of contiguous sequences of one or
|>     more bytes, the number, order and encoding of which are either
|>     explicitely specified or implementation-defined.
|> 
|> This would specifically prohibit separating any part of a structure
|> from the rest.

But only under the as-if rule, that is, if you never take the address of a
structure object the compiler can actually put the parts of it anywhere it
likes, because you couldn't notice the difference.

Andreas.

-- 
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5

  reply	other threads:[~2001-06-25 15:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-23 14:54 Der Herr Hofrat
2001-06-23 15:18 ` Keith Owens
2001-06-23 15:30 ` Russell King
2001-06-24  1:56 ` Richard B. Johnson
2001-06-24  2:12   ` Keith Owens
2001-06-24  2:43     ` Richard B. Johnson
2001-06-24 16:07       ` Lieven Marchand
2001-06-24 16:11       ` frank
2001-06-25  0:26       ` Michael Meissner
2001-06-25 11:32         ` Richard B. Johnson
2001-06-25 13:38           ` Alan Shutko
2001-06-25 14:49             ` Richard B. Johnson
2001-06-25 19:19               ` Alan Shutko
2001-06-25 13:59           ` Alan Shutko
2001-06-25 15:07             ` Andreas Schwab [this message]
2001-06-25 21:25             ` Horst von Brand
2001-06-25 20:43           ` Michael Meissner
2001-06-25  4:33 ` Anil Kumar

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=jeofrc38f6.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=ats@acm.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®