All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Pop <Dan.Pop@cern.ch>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] do me a favor
Date: Tue, 13 Nov 2001 01:20:52 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590698805483@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590698805482@msgid-missing>


On Tue, 13 Nov 2001, Qiu HongBing wrote:

> My problem is as follows:
> 
> struct aa{
> unsigned short a;
> unsigned short b;
> unsigned short c;
> unsigned short d;
> unsigned int e;
> unsigned int f;
> unsigned int g;
> unsigned int h;
> unsigned short i;
> }
> ...
> struct aa *a1;
> ...
> 
> fun1(char *,unsigned int *,char *,char *,unsigned int * temp,unsigned int *)
> {
> ...
> *temp\x10;
> ...
> }
> ...
> 
> fun1(a,b,c,d,&a1->b,e);
> ...
> 
> On IA64 Linux RedHat 7.1(2.4.3-3), when the program run to
> fun1(a,b,c,d,&a1->b,e), the kernel write into syslog some message which is
> "Nov  5 10:12:02 sdv2 kernel: ESMmlx(7837): unaligned access to
> 0x600000000001684c, ip=0x2000000000624370".

The reason is obvious: fun1 expects temp to be a pointer to unsigned
int, but you're passing it &a1->b, which is a pointer to unsigned
short.  The compiler should have actually warned you about that.

> But if I modify the source as follows and it is OK. I dont know why. So I
> want to get some help to solve the real cause.

Then, either define the b member as unsigned int, or the temp
parameter as pointer to unsigned short.

Dan



  reply	other threads:[~2001-11-13  1:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-13  0:57 [Linux-ia64] do me a favor Qiu HongBing
2001-11-13  1:20 ` Dan Pop [this message]
2001-11-13  1:59 ` Qiu HongBing
2001-11-13  2:11 ` Tom King
2001-11-13  4:12 ` Qiu HongBing
2001-11-13 10:04 ` Andreas Schwab
2001-11-13 10:11 ` Qiu HongBing
2001-11-13 11:26 ` Andreas Schwab
2001-11-13 15:30 ` n0ano

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=marc-linux-ia64-105590698805483@msgid-missing \
    --to=dan.pop@cern.ch \
    --cc=linux-ia64@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 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.