Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFC: fix bug in compare_breakpoints
@ 2012-10-17 19:36 Tom Tromey
  2012-10-17 21:25 ` Joel Brobecker
  2012-10-18  8:53 ` Pedro Alves
  0 siblings, 2 replies; 13+ messages in thread
From: Tom Tromey @ 2012-10-17 19:36 UTC (permalink / raw)
  To: gdb-patches

I built gdb with clang today.

This found a bunch of nits (I'll send a nit-cleanup patch later) but
also a couple real bugs.

Here's the first one.  compare_breakpoints has an invalid comparison.

Built (with clang and gcc) and regtested (gcc only) on x86-64 F16.

Tom

2012-10-17  Tom Tromey  <tromey@redhat.com>

	* breakpoint.c (compare_breakpoints): Fix comparison.

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index bebad75..76e3e89 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -11766,7 +11766,7 @@ compare_breakpoints (const void *a, const void *b)
      the number 0.  */
   if (ua < ub)
     return -1;
-  return ub > ub ? 1 : 0;
+  return ua > ub ? 1 : 0;
 }
 
 /* Delete breakpoints by address or line.  */


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

end of thread, other threads:[~2012-11-02 18:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-17 19:36 RFC: fix bug in compare_breakpoints Tom Tromey
2012-10-17 21:25 ` Joel Brobecker
2012-10-18 20:07   ` Tom Tromey
2012-10-18  8:53 ` Pedro Alves
2012-10-18 20:06   ` Tom Tromey
2012-10-19 16:17     ` Tom Tromey
2012-10-19 16:41       ` Add -Wempty-body to warning set (was: Re: RFC: fix bug in compare_breakpoints) Pedro Alves
2012-10-19 16:44         ` Add -Wempty-body to warning set Tom Tromey
2012-10-19 17:00       ` RFC: fix bug in compare_breakpoints Joel Brobecker
2012-10-19 17:03         ` Tom Tromey
2012-10-19 17:12           ` Joel Brobecker
2012-10-19 17:18             ` Pedro Alves
2012-11-02 18:52       ` Tom Tromey

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