From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22883 invoked by alias); 6 Nov 2010 20:33:02 -0000 Received: (qmail 22861 invoked by uid 71); 6 Nov 2010 20:33:01 -0000 Date: Sat, 06 Nov 2010 20:33:00 -0000 Message-ID: <20101106203301.22860.qmail@sourceware.org> To: nobody@sources.redhat.com Cc: insight-prs@sources.redhat.com, From: Johannes Schlatow Subject: Re: insight/352: 2 comparisons in cp-name-parser.y create errors at line 1980 and 1985 Reply-To: Johannes Schlatow Mailing-List: contact insight-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-prs-owner@sourceware.org X-SW-Source: 2010-q4/txt/msg00001.txt.bz2 The following reply was made to PR insight/352; it has been noted by GNATS. From: Johannes Schlatow 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 ";