This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: new warnings building cp-demangle.c


On Mon, 2009-05-18 at 18:25 -0700, Ian Lance Taylor wrote:

> Yep, a bug.  Looks like it should be something like
> 
>   if (p == NULL
>       || name == NULL
>       || (int) kind < gnu_v3_complete_object_ctor
>       || (int) kind > gnu_v3_complete_object_allocating_ctor)

I am committing the following patch (which I assume you have approved,
Ian) :-).  It elimates the warning and there are no test failures with
make check-libiberty.

Cheers, Ben

2009-05-19  Ian Lance Taylor  <iant@google.com>
            Ben Elliston  <bje@au.ibm.com>

        * cp-demangle.c (cplus_demangle_fill_ctor): Fix logic bug.
        (cplus_demangle_fill_dtor): Likewise.

Index: cp-demangle.c
===================================================================
--- cp-demangle.c       (revision 147698)
+++ cp-demangle.c       (working copy)
@@ -719,8 +719,8 @@ cplus_demangle_fill_ctor (struct demangl
 {
   if (p == NULL
       || name == NULL
-      || (kind < gnu_v3_complete_object_ctor
-         && kind > gnu_v3_complete_object_allocating_ctor))
+      || (int) kind < gnu_v3_complete_object_ctor
+      || (int) kind > gnu_v3_complete_object_allocating_ctor)
     return 0;
   p->type = DEMANGLE_COMPONENT_CTOR;
   p->u.s_ctor.kind = kind;
@@ -738,8 +738,8 @@ cplus_demangle_fill_dtor (struct demangl
 {
   if (p == NULL
       || name == NULL
-      || (kind < gnu_v3_deleting_dtor
-         && kind > gnu_v3_base_object_dtor))
+      || (int) kind < gnu_v3_deleting_dtor
+      || (int) kind > gnu_v3_base_object_dtor)
     return 0;
   p->type = DEMANGLE_COMPONENT_DTOR;
   p->u.s_dtor.kind = kind;



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