From e0c45f305525bbc3fd95024e4517a52d1c371868 Mon Sep 17 00:00:00 2001 From: Gary Benson Date: Mon, 20 Apr 2020 15:05:01 +0100 Subject: [PATCH] Fix compilation error with clang in gdb/testsuite/gdb.base/jit-main.c 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(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index b24efc772b2..03771144256 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-04-20 Gary Benson + + * gdb.base/jit-main.c: Fix compilation error with clang. + 2020-04-17 Kamil Rytarowski * gdb.base/attach-twice.c: Include "sys/types.h". diff --git a/gdb/testsuite/gdb.base/jit-main.c b/gdb/testsuite/gdb.base/jit-main.c index 40958ef5b54..37c2a31b3f2 100644 --- a/gdb/testsuite/gdb.base/jit-main.c +++ b/gdb/testsuite/gdb.base/jit-main.c @@ -128,7 +128,7 @@ update_locations (const void *const addr, int idx) /* 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; -- 2.30.2