Ben Elliston <b...@au1.ibm.com> writes:

> In the last couple of days, I have started seeing the following warnings
> when building target-libiberty:
>
> /home/bje/source/gcc-clean/libiberty/cp-demangle.c:723: warning: logical 
> ‘and’ of mutually exclusive tests is always false
> /home/bje/source/gcc-clean/libiberty/cp-demangle.c:742: warning: logical 
> ‘and’ of mutually exclusive tests is always false
>
> The code around line 723 is:
>
>   if (p == NULL
>       || name == NULL
>       || (kind < gnu_v3_complete_object_ctor
>           && kind > gnu_v3_complete_object_allocating_ctor))
>     return 0;
>
> (and similarly for line 742).  A bug?

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)

Ian

Reply via email to