This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[Patch, Applied] Re: array11.C failing on all LP64 targets
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Fri, 19 Sep 2003 07:43:48 -0700
- Subject: [Patch, Applied] Re: array11.C failing on all LP64 targets
- References: <200309191430.h8JEUgo2029230@caip.rutgers.edu>
On Sep 19, 2003, at 07:30, Kaveh R. Ghazi wrote:
Andrew,
The new testcase you added for PR middle-end/11665 fails on all LP64
targets because of this:
Excess errors:
g++.dg/init/array11.C:21: warning: cast from pointer to integer of
different size
Instead of casting the pointer to unsigned, you need to cast to
"unsigned long" as is done in g++.dg/init/struct1.C or perhaps to
__SIZE_TYPE__. It's currently failing on mainline and 3.3.x.
I forget all the time about LP64 targets and this is what I get when I
use the testcase from the bug report.
Fixed thus on both 3.3 and the mainline.
ChangeLog:
* g++.dg/init/array11.C: Change unsigned to __SIZE_TYPE__
so that it will not complain on LP64 targets.
Patch:
Index: g++.dg/init/array11.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/init/array11.C,v
retrieving revision 1.1
diff -u -p -r1.1 array11.C
--- g++.dg/init/array11.C 8 Sep 2003 03:05:52 -0000 1.1
+++ g++.dg/init/array11.C 19 Sep 2003 14:35:31 -0000
@@ -8,9 +8,12 @@
constant value when it is not. */
int x;
+
+typedef __SIZE_TYPE__ size_t;
+
struct gdt
{
-unsigned a,b,c,d,e,f;
+size_t a,b,c,d,e,f;
};
void f()
{
@@ -18,7 +21,7 @@ struct gdt gdt_table[2]=
{
{
0,
- ( (((unsigned)(&x))<<(24))&(-1<<(8)) ),
+ ( (((size_t)(&x))<<(24))&(-1<<(8)) ),
},
};
}