[OB] Fix compilation error with clang in gdb/testsuite/gdb.base/jit-main.c

Message ID 1587391660-8590-1-git-send-email-gbenson@redhat.com
State New
Headers show
Series
  • [OB] Fix compilation error with clang in gdb/testsuite/gdb.base/jit-main.c
Related show

Commit Message

Rogerio Alves via Gdb-patches April 20, 2020, 2:07 p.m.
Clang fails to compile the above file, with the following error:
  warning: while loop has empty body [-Wempty-body]

This prevents the following testcases from executing:
  gdb.base/jit.exp
  gdb.base/jit-so.exp
---
 gdb/testsuite/ChangeLog           | 4 ++++
 gdb/testsuite/gdb.base/jit-main.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

-- 
1.8.3.1

Patch

diff --git a/gdb/testsuite/gdb.base/jit-main.c b/gdb/testsuite/gdb.base/jit-main.c
index 40958ef..37c2a31 100644
--- a/gdb/testsuite/gdb.base/jit-main.c
+++ b/gdb/testsuite/gdb.base/jit-main.c
@@ -128,7 +128,7 @@  void __attribute__((noinline)) __jit_debug_register_code () { }
 
 /* Used to spin waiting for GDB.  */
 volatile int wait_for_gdb = ATTACH;
-#define WAIT_FOR_GDB while (wait_for_gdb)
+#define WAIT_FOR_GDB do {} while (wait_for_gdb)
 
 /* The current process's PID.  GDB retrieves this.  */
 int mypid;