Re: ac18: arch/i386/traps.c:546: warning: `and' of mutually exclusive equal-tests is always zero

From: Philipp Rumpf (prumpf@puffin.external.hp.com)
Date: Tue Jun 13 2000 - 17:15:18 EST


On Tue, Jun 13, 2000 at 11:47:02PM +0200, Roger Larsson wrote:
> Compiled with silent... got a warning I have not seen previously
>
>
> - if ((tsk->flags & (PF_DTRACE|PF_PTRACED)) == PF_DTRACE)
> + if ((tsk->ptrace & PT_DTRACE) && (!tsk->ptrace&PT_PTRACED))
>
> shouldn't it be
>
> - if ((tsk->flags & (PF_DTRACE|PF_PTRACED)) == PF_DTRACE)
> + if ((tsk->ptrace & PT_DTRACE) && !(tsk->ptrace&PT_PTRACED))
>
> or the rather unreadable
>
> - if ((tsk->flags & (PF_DTRACE|PF_PTRACED)) == PF_DTRACE)
> + if ((tsk->ptrace & PT_DTRACE) && (~tsk->ptrace&PT_PTRACED))

in fact it should be

        if ((tsk->ptrace & (PT_DTRACE|PT_PTRACED)) == PT_DTRACE)

--- linux/arch/i386/kernel/traps.c Tue Jun 13 12:36:35 2000
+++ linux-prumpf/arch/i386/kernel/traps.c Tue Jun 13 14:37:53 2000
@@ -543,7 +543,7 @@
                  * allowing programs to debug themselves without the ptrace()
                  * interface.
                  */
- if ((tsk->ptrace & PT_DTRACE) && (!tsk->ptrace&PT_PTRACED))
+ if ((tsk->ptrace & (PT_DTRACE|PT_PTRACED)) == PT_DTRACE)
                         goto clear_TF;
         }
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:30 EST