[OB PATCH] Fix compilation error with clang in gdb/testsuite/gdb.trace/tspeed.c

Simon Marchi simark@simark.ca
Mon Apr 20 14:11:13 GMT 2020


On 2020-04-20 10:08 a.m., Gary Benson via Gdb-patches wrote:
> 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          | 5 +++++
>  gdb/testsuite/gdb.trace/tspeed.c | 2 +-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.trace/tspeed.c b/gdb/testsuite/gdb.trace/tspeed.c
> index b2c26bb..39a6646 100644
> --- a/gdb/testsuite/gdb.trace/tspeed.c
> +++ b/gdb/testsuite/gdb.trace/tspeed.c
> @@ -75,7 +75,7 @@
>  
>        /* 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)
> -- 
> 1.8.3.1
> 

Hi Gary,

For some reason, we don't see you ChangeLog entry in the patch (although
the diffstat shows changes to it), but it looks like:

+2020-04-20  Gary Benson <gbenson@redhat.com>
+
+       * gdb/testsuite/gdb.trace/tspeed.c: Fix compilation error with
+       clang.

The filename should not have the gdb/testsuite part.

Simon


More information about the Gdb-patches mailing list