This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/27272] New: Strange order of components of multidimensional array pointer with the same cast
- From: "prog1 at yobinario dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Apr 2006 16:32:06 -0000
- Subject: [Bug c/27272] New: Strange order of components of multidimensional array pointer with the same cast
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
char *yn;
yn = (char *) malloc (sizeof (char) * x * y);
First subroutine included with {}:
char (*pointer)[x][y] = (char (*)[x][y]) yn;
&((*pointer)[0][0]) is 0x8052100
&((*pointer)[0][1]) is 0x8052107
Second routine independent function passed as pointer yn as parameter;
char (*pointer)[x][y] = (char (*)[x][y]) yn;
In second routine the pointers only is the same if (x) y replaced with (y) and
(y) with (x)
&((*pointer)[0][0]) with pointer 0x8052100
&((*pointer)[1][0]) with pointer 0x8052107
--
Summary: Strange order of components of multidimensional array
pointer with the same cast
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: prog1 at yobinario dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27272