Make the wait-for-gdb delay loop somewhat more modern-compiler-proof.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11855 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_main.c b/coregrind/m_main.c
index a3d21be..d724d53 100644
--- a/coregrind/m_main.c
+++ b/coregrind/m_main.c
@@ -1841,8 +1841,7 @@
/* 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 @@
# error "Unknown plat"
# endif
- iters *= 1000*1000*1000;
+ iters *= 1000ULL * 1000 * 1000;
for (q = 0; q < iters; q++)
- ;
+ __asm__ __volatile__("" ::: "memory","cc");
}
//--------------------------------------------------------------