Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [OB PATCH] Fix compilation error with clang in gdb/testsuite/gdb.trace/tspeed.c
@ 2020-04-20 14:08 Gary Benson
  2020-04-20 14:11 ` Simon Marchi
  0 siblings, 1 reply; 5+ messages in thread
From: Gary Benson @ 2020-04-20 14:08 UTC (permalink / raw)
  To: gdb-patches

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OB PATCH] Fix compilation error with clang in gdb/testsuite/gdb.trace/tspeed.c
  2020-04-20 14:08 [OB PATCH] Fix compilation error with clang in gdb/testsuite/gdb.trace/tspeed.c Gary Benson
@ 2020-04-20 14:11 ` Simon Marchi
  2020-04-20 14:15   ` Gary Benson
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Marchi @ 2020-04-20 14:11 UTC (permalink / raw)
  To: Gary Benson, gdb-patches

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OB PATCH] Fix compilation error with clang in gdb/testsuite/gdb.trace/tspeed.c
  2020-04-20 14:11 ` Simon Marchi
@ 2020-04-20 14:15   ` Gary Benson
  2020-04-20 14:16     ` Simon Marchi
  0 siblings, 1 reply; 5+ messages in thread
From: Gary Benson @ 2020-04-20 14:15 UTC (permalink / raw)
  To: gdb-patches

Simon Marchi wrote:
> 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
> 
> 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.

It's not my day today!  Should I commit a fix to the ChangeLog, or
should I leave it alone?

Thanks,
Gary



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OB PATCH] Fix compilation error with clang in gdb/testsuite/gdb.trace/tspeed.c
  2020-04-20 14:15   ` Gary Benson
@ 2020-04-20 14:16     ` Simon Marchi
  2020-04-20 16:05       ` Gary Benson
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Marchi @ 2020-04-20 14:16 UTC (permalink / raw)
  To: Gary Benson, gdb-patches

On 2020-04-20 10:15 a.m., Gary Benson via Gdb-patches wrote:
> It's not my day today!  Should I commit a fix to the ChangeLog, or
> should I leave it alone?

Yes, just push a simple fix to the ChangeLog (this fix shouldn't have a ChangeLog entry of its own :)).

Simon


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OB PATCH] Fix compilation error with clang in gdb/testsuite/gdb.trace/tspeed.c
  2020-04-20 14:16     ` Simon Marchi
@ 2020-04-20 16:05       ` Gary Benson
  0 siblings, 0 replies; 5+ messages in thread
From: Gary Benson @ 2020-04-20 16:05 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

Simon Marchi wrote:
> On 2020-04-20 10:15 a.m., Gary Benson via Gdb-patches wrote:
> > It's not my day today!  Should I commit a fix to the ChangeLog, or
> > should I leave it alone?
> 
> Yes, just push a simple fix to the ChangeLog (this fix shouldn't
> have a ChangeLog entry of its own :)).

Done.

Thanks,
Gary



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-20 16:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 14:08 [OB PATCH] Fix compilation error with clang in gdb/testsuite/gdb.trace/tspeed.c Gary Benson
2020-04-20 14:11 ` Simon Marchi
2020-04-20 14:15   ` Gary Benson
2020-04-20 14:16     ` Simon Marchi
2020-04-20 16:05       ` Gary Benson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox