This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Fix 64bit issues with recent test
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 11 Dec 2008 12:57:56 -0500
- Subject: [lto] Fix 64bit issues with recent test
This patch uses uintptr_t to avoid warnings on 64 bit hosts.
Diego.
* gcc.dg/lto/20081210-1_0.c: Fix for 64bit hosts.
Index: testsuite/gcc.dg/lto/20081210-1_0.c
===================================================================
--- testsuite/gcc.dg/lto/20081210-1_0.c (revision 142678)
+++ testsuite/gcc.dg/lto/20081210-1_0.c (working copy)
@@ -1,7 +1,13 @@
-extern void srand (unsigned int);
+#if defined(_LP64) || defined(_WIN64)
+typedef unsigned long int uintptr_t;
+#else
+typedef unsigned int uintptr_t;
+#endif
+
+extern void srand (uintptr_t);
inline void
-foo (unsigned int seed)
+foo (uintptr_t seed)
{
srand (seed * seed);
}
@@ -10,6 +16,6 @@ int
main ()
{
foo (0);
- srand ((unsigned int) (&foo));
+ srand ((uintptr_t) (&foo));
return 0;
}