From: "Qiu HongBing" <qiuhb@necas.nec.co.jp>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] do me a favor
Date: Tue, 13 Nov 2001 01:59:07 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590698805485@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590698805482@msgid-missing>
But next example happened same.
...
newtComponent newtEntry(int left, int top, const char* initialValue, int
width, char** resultPtr,int flags);
...
char d[20][20];
...
entry[2]=newtEntry(-1,-1,d[2],10,(char**)&d[11],NEWT_ENTRY_SCROLL);--->>outp
ut the unaligned access
...
entry[3]=newtEntry(-1,-1,d[7],10,(char**)&d[16],NEWT_ENTRY_SCROLL);
...
but , If I changed it to as follows and it is OK.
...
newtComponent newtEntry9int left, int top, const char* initialValue, int
width, char** resultPtr,int flags);
...
char d[20][20];
...
{
char temp[20];
sprintf(temp,"%s",d[11]);
entry[2]=newtEntry(-1,-1,d[2],10,(char**)&temp/*&d[11]*/,NEWT_ENTRY_SCROLL);
sprintf(d[11],"%s",temp);
}
...
entry[3]=newtEntry(-1,-1,d[7],10,(char**)&d[16],NEWT_ENTRY_SCROLL);
...
I want to know why.
That's all.
Thanks.
--Qiu HongBing
----- Original Message -----
From: "Dan Pop" <Dan.Pop@cern.ch>
To: "Qiu HongBing" <qiuhb@necas.nec.co.jp>
Cc: <linux-ia64@linuxia64.org>
Sent: Tuesday, November 13, 2001 9:20 AM
Subject: Re: [Linux-ia64] do me a favor
>
>
> 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
>
>
next prev parent reply other threads:[~2001-11-13 1:59 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
2001-11-13 1:59 ` Qiu HongBing [this message]
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-105590698805485@msgid-missing \
--to=qiuhb@necas.nec.co.jp \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox