[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Address of bug using array notation?
From: |
Rob Landley |
Subject: |
Re: [Tinycc-devel] Address of bug using array notation? |
Date: |
Sat, 7 Oct 2006 14:18:30 -0400 |
User-agent: |
KMail/1.9.1 |
On Friday 06 October 2006 6:37 pm, Oded Shimon wrote:
> On Fri, Oct 06, 2006 at 03:18:35PM -0700, Mike Henning wrote:
> > If I have a number stored in a character array and try
> > to casr to an integer it returns the incorrect result
> > using array notation.
> >
> > int i;
> > int ii=443221;
> > char test[20]
> >
> > memcpy(test, ii, sizeof(ii));
> > i = *(int*)test <--- This works
> >
> > memcpy(&test[4], ii, sizeof(ii));
> > i = *(int*)&test[4] <--- This doesn't work
> > i = *(int*)(test+4) <--- This works
> >
> > Any takers? :)
>
> Hehe
>
> http://lists.gnu.org/archive/html/tinycc-devel/2005-07/msg00068.html
> (the very reason i subscribed to this list)
Did anybody ever track down the cause and post a patch?
Rob
--
Never bet against the cheap plastic solution.