This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch]: Fix build of gdb with gcc 4.5


Hello,

ChangeLog
2009-07-27  Kai Tietz  <kai.tietz@onevision.com>

	* ada-lang.c (ada_attribute_name): Fix compare of different
	enum types.
	* cp-name-parser.y: Likewise.
	* dwarf2read.c: Likewise.

Tested for i686-pc-cygwin and for x86_64-pc-mingw32. Ok for apply?

Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
? gdb.diff
Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.229
diff -u -3 -r1.229 ada-lang.c
--- ada-lang.c	2 Jul 2009 17:25:52 -0000	1.229
+++ ada-lang.c	27 Jul 2009 18:37:08 -0000
@@ -7498,7 +7498,7 @@
 const char *
 ada_attribute_name (enum exp_opcode n)
 {
-  if (n >= OP_ATR_FIRST && n <= (int) OP_ATR_VAL)
+  if (n >= (int) OP_ATR_FIRST && n <= (int) OP_ATR_VAL)
     return attribute_names[n - OP_ATR_FIRST + 1];
   else
     return attribute_names[0];
@@ -8005,7 +8005,7 @@
       elt = ada_to_fixed_value (unwrap_value (elt));
     }
 
-  if (exp->elts[*pos].opcode == OP_AGGREGATE)
+  if (exp->elts[*pos].opcode == (int) OP_AGGREGATE)
     assign_aggregate (container, elt, exp, pos, EVAL_NORMAL);
   else
     value_assign_to_component (container, elt, 
@@ -8160,7 +8160,7 @@
     {
       LONGEST lower, upper;
       enum exp_opcode op = exp->elts[choice_pos].opcode;
-      if (op == OP_DISCRETE_RANGE)
+      if (op == (int) OP_DISCRETE_RANGE)
 	{
 	  choice_pos += 1;
 	  lower = value_as_long (ada_evaluate_subexp (NULL, exp, pos,
@@ -8578,7 +8578,7 @@
 
     case BINOP_ASSIGN:
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-      if (exp->elts[*pos].opcode == OP_AGGREGATE)
+      if (exp->elts[*pos].opcode == (int) OP_AGGREGATE)
 	{
 	  arg1 = assign_aggregate (arg1, arg1, exp, pos, noside);
 	  if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS)
@@ -9198,7 +9198,7 @@
 	{
 	  binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2);
 	  return value_binop (arg1, arg2,
-			      op == OP_ATR_MIN ? BINOP_MIN : BINOP_MAX);
+			      op == (int) OP_ATR_MIN ? BINOP_MIN : BINOP_MAX);
 	}
 
     case OP_ATR_MODULUS:
Index: cp-name-parser.y
===================================================================
RCS file: /cvs/src/src/gdb/cp-name-parser.y,v
retrieving revision 1.15
diff -u -3 -r1.15 cp-name-parser.y
--- cp-name-parser.y	31 Mar 2009 20:21:06 -0000	1.15
+++ cp-name-parser.y	27 Jul 2009 18:37:09 -0000
@@ -1979,12 +1979,12 @@
   char *str, *prefix = NULL, *buf;
   size_t err = 0;
 
-  if (result->type == GLOBAL_DESTRUCTORS)
+  if (result->type == (int) GLOBAL_DESTRUCTORS)
     {
       result = d_left (result);
       prefix = "global destructors keyed to ";
     }
-  else if (result->type == GLOBAL_CONSTRUCTORS)
+  else if (result->type == (int) GLOBAL_CONSTRUCTORS)
     {
       result = d_left (result);
       prefix = "global constructors keyed to ";
@@ -2048,7 +2048,7 @@
   char *str;
   size_t err = 0;
 
-  if (result->type == GLOBAL_DESTRUCTORS)
+  if (result->type == (int) GLOBAL_DESTRUCTORS)
     {
       result = d_left (result);
       fputs ("global destructors keyed to ", stdout);
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.324
diff -u -3 -r1.324 dwarf2read.c
--- dwarf2read.c	20 Jul 2009 21:21:17 -0000	1.324
+++ dwarf2read.c	27 Jul 2009 18:37:15 -0000
@@ -8999,7 +8999,7 @@
 	 to canonicalize them.  */
       return DW_STRING (attr);
     default:
-      if (attr->form != GDB_FORM_cached_string)
+      if (attr->form != (int) GDB_FORM_cached_string)
 	{
 	  DW_STRING (attr)
 	    = dwarf2_canonicalize_name (DW_STRING (attr), cu,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]