From: Julian Seward Date: Tue, 5 Jul 2011 09:13:41 +0000 (+0000) Subject: Make the wait-for-gdb delay loop somewhat more modern-compiler-proof. X-Git-Tag: svn/VALGRIND_3_7_0~382 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6f3302aeb62b54f871a12fcfdf34d0f10ce8347;p=thirdparty%2Fvalgrind.git Make the wait-for-gdb delay loop somewhat more modern-compiler-proof. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11855 --- diff --git a/coregrind/m_main.c b/coregrind/m_main.c index a3d21be9a8..d724d53e1f 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -1841,8 +1841,7 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp ) /* Hook to delay things long enough so we can get the pid and attach GDB in another shell. */ if (VG_(clo_wait_for_gdb)) { - Long iters; - volatile Long q; + ULong iters, q; VG_(debugLog)(1, "main", "Wait for GDB\n"); VG_(printf)("pid=%d, entering delay loop\n", VG_(getpid)()); @@ -1862,9 +1861,9 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp ) # error "Unknown plat" # endif - iters *= 1000*1000*1000; + iters *= 1000ULL * 1000 * 1000; for (q = 0; q < iters; q++) - ; + __asm__ __volatile__("" ::: "memory","cc"); } //--------------------------------------------------------------