]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix compilation error with clang in gdb/testsuite/gdb.base/jit-main.c
authorGary Benson <gbenson@redhat.com>
Mon, 20 Apr 2020 14:05:01 +0000 (15:05 +0100)
committerGary Benson <gbenson@redhat.com>
Mon, 20 Apr 2020 14:06:13 +0000 (15:06 +0100)
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
gdb/testsuite/gdb.base/jit-main.c

index b24efc772b27d97eb47d355deca35f6b0f510681..037711442566295c701d12f59cb8d8bd46f25a01 100644 (file)
@@ -1,3 +1,7 @@
+2020-04-20  Gary Benson <gbenson@redhat.com>
+
+       * gdb.base/jit-main.c: Fix compilation error with clang.
+
 2020-04-17  Kamil Rytarowski  <n54@gmx.com>
 
        * gdb.base/attach-twice.c: Include "sys/types.h".
index 40958ef5b54472bef397e8a25660481f3329d2cc..37c2a31b3f2ab078ba1b723a3c2056bc0eaaf5e4 100644 (file)
@@ -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;