netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: Sridhar Samudrala <sri@us.ibm.com>
Cc: acme@conectiva.com.br, netdev@oss.sgi.com,
	lksctp-developers@lists.sourceforge.net
Subject: Re: net/sctp/sm_make_chunk.c alignment problems on parisc64
Date: Thu, 18 Sep 2003 19:55:25 -0700	[thread overview]
Message-ID: <20030918195525.28c17cb1.davem@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0309171559540.3831-100000@localhost.localdomain>

On Wed, 17 Sep 2003 16:06:18 -0700 (PDT)
Sridhar Samudrala <sri@us.ibm.com> wrote:

> I don't see this problem on i386, ia64 or ppc64. Can someone
> familiar with parisc64 provide more details or submit a a patch to
> fix this problem?

As an example, if you have an structure member of type "char":

struct foo {
	char	a;
	char	b[4];
};

And then try to do something like this:

	struct foo *p;
	unsigned int *v;

	v = (unsigned int *) (&p->b[0]);
	*v = 0;

The build is going to explode on parisc because this simply is not
allowed.  You cannot access a structure member as an object which
has larger alignment than is guarenteed for the type that member
has.

In the above example we're trying to access with 'unsigned int'
alignment a member which is only guarenteed to have the alignment
for a 'char'.

  reply	other threads:[~2003-09-19  2:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-12 16:46 net/sctp/sm_make_chunk.c alignment problems on parisc64 Arnaldo Carvalho de Melo
2003-09-17 23:06 ` Sridhar Samudrala
2003-09-19  2:55   ` David S. Miller [this message]
2003-09-19 22:15     ` Sridhar Samudrala
2003-09-20  6:39       ` David S. Miller
2003-09-20 15:54         ` Arnaldo Carvalho de Melo
2003-09-22 22:06           ` Sridhar Samudrala
2003-09-25 20:52             ` Arnaldo Carvalho de Melo

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=20030918195525.28c17cb1.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=acme@conectiva.com.br \
    --cc=lksctp-developers@lists.sourceforge.net \
    --cc=netdev@oss.sgi.com \
    --cc=sri@us.ibm.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 NNTP newsgroup(s).