public inbox for insight-prs@sourceware.org
help / color / mirror / Atom feed
* insight/352: 2 comparisons in cp-name-parser.y create errors at line 1980 and 1985
@ 2010-07-23  7:23 captainhaggy
  0 siblings, 0 replies; 3+ messages in thread
From: captainhaggy @ 2010-07-23  7:23 UTC (permalink / raw)
  To: insight-gnats

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1950 bytes --]


>Number:         352
>Category:       insight
>Synopsis:       2 comparisons in cp-name-parser.y create errors at line 1980 and 1985
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 23 07:23:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     2 comparison errors in cp-name-parser.y, line 1980 and 1985
>Release:        6.8 and 6.8.1
>Organization:
>Environment:
Archlinux, Atom N270, 2 GB Ram, Kernel 2.6.34.1, GCC 4.5.0-6
>Description:
I get two comparison errors in cp-name-parser.y

gcc -c -march=i686 -mtune=generic -O2 -pipe   -I. -I.././gdb -I.././gdb/config -DLOCALEDIR="\"/opt/insight/share/locale\"" -DHAVE_CONFIG_H -I.././gdb/../include/opcode -I.././gdb/../readline/.. -I../bfd -I.././gdb/../bfd -I.././gdb/../include -I../libdecnumber -I.././gdb/../libdecnumber   -DMI_OUT=1 -DGDBTK -DTUI=1  -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wno-switch -Wno-char-subscripts -Werror cp-name-parser.c
cc1: warnings being treated as errors
cp-name-parser.y: In Funktion »cp_comp_to_string«:
cp-name-parser.y:1980:20: Fehler: comparison between »enum demangle_component_type« and »enum <anonym>«
cp-name-parser.y:1985:25: Fehler: comparison between »enum demangle_component_type« and »enum <anonym>«
make[2]: *** [cp-name-parser.o] Fehler 1
make[2]: Leaving directory `/tmp/yaourt-tmp-karl/aur-insight/src/insight-6.8/gdb'
make[1]: *** [all-gdb] Fehler 2
make[1]: Leaving directory `/tmp/yaourt-tmp-karl/aur-insight/src/insight-6.8'
make: *** [all] Fehler 2
    Breche ab ...
==> ERROR: Makepkg was unable to build insight.
>How-To-Repeat:
Manually, unpacking the package, ./configure works and make stops ever at the same source-package with those two errors.
>Fix:
fix the comparison
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: insight/352: 2 comparisons in cp-name-parser.y create errors at line 1980 and 1985
@ 2010-11-06 20:33 Johannes Schlatow
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Schlatow @ 2010-11-06 20:33 UTC (permalink / raw)
  To: nobody; +Cc: insight-prs

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 ";


^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: insight/352: 2 comparisons in cp-name-parser.y create errors at line 1980 and 1985
@ 2010-11-10 19:27 kseitz
  0 siblings, 0 replies; 3+ messages in thread
From: kseitz @ 2010-11-10 19:27 UTC (permalink / raw)
  To: captainhaggy, insight-prs, kseitz, nobody

Synopsis: 2 comparisons in cp-name-parser.y create errors at line 1980 and 1985

Responsible-Changed-From-To: unassigned->kseitz
Responsible-Changed-By: kseitz
Responsible-Changed-When: Wed Nov 10 19:27:40 2010
Responsible-Changed-Why:
    mine
State-Changed-From-To: open->closed
State-Changed-By: kseitz
State-Changed-When: Wed Nov 10 19:27:40 2010
State-Changed-Why:
    Thanks for the report. Normally, this bug would need to be filed against gdb, since the files in question are gdb's responsibility.
    
    However, since 6.8, cp-name-parser.y has undergone quite a bit of change, and I believe this problem no longer exists.

http://sourceware.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=insight&pr=352


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

end of thread, other threads:[~2010-11-10 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-23  7:23 insight/352: 2 comparisons in cp-name-parser.y create errors at line 1980 and 1985 captainhaggy
2010-11-06 20:33 Johannes Schlatow
2010-11-10 19:27 kseitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).