This is the mail archive of the insight-prs@sourceware.org mailing list for the Insight 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]

Re: insight/352: 2 comparisons in cp-name-parser.y create errorsat line 1980 and 1985


The following reply was made to PR insight/352; it has been noted by GNATS.

From: Johannes Schlatow <johannes.schlatow@googlemail.com>
To: insight-gnats@sources.redhat.com
Cc:  
Subject: Re: insight/352: 2 comparisons in cp-name-parser.y create errors
 at line 1980 and 1985
Date: Sat, 06 Nov 2010 21:30:57 +0100

 I just encountered the same problem. I think the gcc 4.5 is somewhat more restrictive when it comes to the comparison of enums. Thus I patched the corresponding lines:
 
 diff -rup insight-6.8/gdb//ada-lang.c insight-6.8_patch/gdb//ada-lang.c
 --- insight-6.8/gdb//ada-lang.c	2008-02-07 23:27:53.000000000 +0100
 +++ insight-6.8_patch/gdb//ada-lang.c	2010-11-06 20:38:22.000000000 +0100
 @@ -7683,7 +7683,7 @@ static const char *attribute_names[] = {
  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];
 @@ -8183,7 +8183,7 @@ assign_component (struct value *containe
        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, 
 @@ -8338,7 +8338,7 @@ aggregate_assign_from_choices (struct va
      {
        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,
 @@ -8537,7 +8537,7 @@ ada_evaluate_subexp (struct type *expect
  
      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)
 @@ -9096,7 +9096,7 @@ ada_evaluate_subexp (struct type *expect
          return value_zero (value_type (arg1), not_lval);
        else
          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:
        {
 
 diff -rup insight-6.8/gdb//cp-name-parser.y insight-6.8_patch/gdb//cp-name-parser.y
 --- insight-6.8/gdb//cp-name-parser.y	2008-01-01 23:53:09.000000000 +0100
 +++ insight-6.8_patch/gdb//cp-name-parser.y	2010-11-06 20:38:22.000000000 +0100
 @@ -1977,12 +1977,12 @@ cp_comp_to_string (struct demangle_compo
    char *str, *prefix = NULL, *buf;
    size_t err = 0;
  
 -  if (result->type == GLOBAL_DESTRUCTORS)
 +  if ((int)result->type == GLOBAL_DESTRUCTORS)
      {
        result = d_left (result);
        prefix = "global destructors keyed to ";
      }
 -  else if (result->type == GLOBAL_CONSTRUCTORS)
 +  else if ((int)result->type == GLOBAL_CONSTRUCTORS)
      {
        result = d_left (result);
        prefix = "global constructors keyed to ";


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