This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: new warnings building cp-demangle.c
- From: Ben Elliston <bje at au1 dot ibm dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 May 2009 12:16:10 +1000
- Subject: Re: new warnings building cp-demangle.c
- References: <1242692901.16289.5.camel@helios> <m3skj1anos.fsf@google.com>
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;