Fix compilation error with clang in gdb/testsuite/gdb.trace/tspeed.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: using the result of an assignment as a condition without
  parentheses [-Wparentheses]

This prevents the following testcase from executing:
  gdb.trace/tspeed.exp

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.trace/tspeed.c

index 037711442566295c701d12f59cb8d8bd46f25a01..8ee15208ceaf3f0b79b48d109c95cd1ef69bc40d 100644 (file)
@@ -1,3 +1,8 @@
+2020-04-20  Gary Benson <gbenson@redhat.com>
+
+       * gdb/testsuite/gdb.trace/tspeed.c: Fix compilation error with
+       clang.
+
 2020-04-20  Gary Benson <gbenson@redhat.com>
 
        * gdb.base/jit-main.c: Fix compilation error with clang.
index b2c26bba44d88067cb0fc8e89a97a81dc39e9c63..39a6646b2232d66c30b0a4aab10f3f0c5904b487 100644 (file)
@@ -75,7 +75,7 @@ main(int argc, char **argv)
 
       /* Keep trying the speed test, with more iterations, until
         we get to a reasonable number.  */
-      while (problem = trace_speed_test())
+      while ((problem = trace_speed_test()))
        {
          /* If iteration isn't working, give up.  */
          if (iters > max_iters)