This is the mail archive of the gcc@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, May 18, 2009 at 5:28 PM, Ben Elliston <bje@au1.ibm.com> wrote:
> Hi Ian
>
> 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;
>

We have

enum gnu_v3_ctor_kinds {
  gnu_v3_complete_object_ctor = 1,
  gnu_v3_base_object_ctor,
  gnu_v3_complete_object_allocating_ctor
};

What does

(kind < gnu_v3_complete_object_ctor
         && kind > gnu_v3_complete_object_allocating_ctor)

try to check? It looks like a typo to me.


-- 
H.J.


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