All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Shutko <ats@acm.org>
To: root@chaos.analogic.com
Cc: Michael Meissner <meissner@spectacle-pond.org>,
	Keith Owens <kaos@ocs.com.au>,
	linux-kernel@vger.kernel.org
Subject: Re: sizeof problem in kernel modules
Date: Mon, 25 Jun 2001 15:19:48 -0400	[thread overview]
Message-ID: <87ithk5px4.fsf@wesley.springies.com> (raw)
In-Reply-To: <Pine.LNX.3.95.1010625094914.7314A-100000@chaos.analogic.com>
In-Reply-To: <Pine.LNX.3.95.1010625094914.7314A-100000@chaos.analogic.com>

"Richard B. Johnson" <root@chaos.analogic.com> writes:

> > ISO/IEC 9899:1990 6.5.2.1:
> > 
> >   As discussed in 6.1.2.5, a structure is a type consisting of a
> >   sequence of named members, whose storage is allocated in an ordered
> >   sequence, and a union [stuff we don't care about].
> >
> 
> Does "ordered sequence" mean "incremental"? I think not.

It does mean there is an order, as defined below.

>  
> >   Within a structure object, the non-bit-field members and the units
> >   in which bit-fields reside have addresses that increase in the order
> >   in which they declared.
> 
> 
> Really?? Did you TYPE this in or did you copy it from somewhere??

I typed it in and forgot an "are".  Forgive me, but this doesn't
change the point, and you could have easily looked in the standard
yourself to see where I mistyped.

> And... If this was a part of a C specification

Which it is.

> it would prevent the inclusion of const data within a structure
> unless the entire structure was of type const.

No.  The C standard does not guarantee that const items be placed in
RO memory.  It does not even require that the host have RO memory, or
that an implementation do the same thing with a const object as a
const member of a structure.

> >   There may therefore be unnammed padding withing a structure object,

> Unnamed and within are spelled incorrectly. This is not a valid
> document.

Geez, would you rather I scan it for you?  

> This way, the compiler "knows" where things are and handles duplication
> accordingly.

Of course it knows where things are, since a structure is a single
contiguous range of memory, according to the standard.

Would you care to offer counter citations?  Have you even looked at
the standard?

-- 
Alan Shutko <ats@acm.org> - In a variety of flavors!
Please keep your hands off the secretary's reproducing equipment.

  reply	other threads:[~2001-06-25 19:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-23 14:54 sizeof problem in kernel modules 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 13:59             ` Alan Shutko
2001-06-25 15:07               ` Andreas Schwab
2001-06-25 21:25               ` Horst von Brand
2001-06-25 14:49             ` Richard B. Johnson
2001-06-25 19:19               ` Alan Shutko [this message]
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=87ithk5px4.fsf@wesley.springies.com \
    --to=ats@acm.org \
    --cc=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meissner@spectacle-pond.org \
    --cc=root@chaos.analogic.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.