diff mbox

Merge GCC producer parsers. Allow digits in identifiers.

Message ID 20150210235058.GD17507@blokker.redhat.com
State New
Headers show

Commit Message

Mark Wielaard Feb. 10, 2015, 11:50 p.m. UTC
On Tue, Feb 10, 2015 at 06:15:44PM -0500, Patrick Palka wrote:
> Now that producer_is_gcc() returns a bool, shouldn't the statement
> 'return -1' become 'return false;', and the statement 'return major;'
> become 'return true;'?

Yes, of course. What a silly mistake. Thanks for catching that.

I pushed the attached as obvious.
From 9f615e3af0356052a475812cb5a4380a5fe51182 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw@redhat.com>
Date: Wed, 11 Feb 2015 00:45:31 +0100
Subject: [PATCH] gdb producer_is_gcc fix bool return value.

gdb/ChangeLog:

	* utils.c (producer_is_gcc): Return true or false.
---
 gdb/ChangeLog | 4 ++++
 gdb/utils.c   | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a23c2d8..fe61d24 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@ 
+2015-02-11  Mark Wielaard  <mjw@redhat.com>
+
+	* utils.c (producer_is_gcc): Return true or false.
+
 2015-02-04  Mark Wielaard  <mjw@redhat.com>
 
 	* utils.h (producer_is_gcc): Change return type to bool. Add major
diff --git a/gdb/utils.c b/gdb/utils.c
index 2b54739..3ce5814 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -3299,11 +3299,11 @@  producer_is_gcc (const char *producer, int *major, int *minor)
       if (*cs && isspace (*cs))
         cs++;
       if (sscanf (cs, "%d.%d", major, minor) == 2)
-	return major;
+	return true;
     }
 
   /* Not recognized as GCC.  */
-  return -1;
+  return false;
 }
 
 /* Helper for make_cleanup_free_char_ptr_vec.  */