This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]