|| o->op_type == OP_BIT_AND
|| o->op_type == OP_BIT_XOR)
{
- OPCODE typfirst = cBINOPo->op_first->op_type;
- OPCODE typlast = cBINOPo->op_first->op_sibling->op_type;
- if (OP_IS_NUMCOMPARE(typfirst) || OP_IS_NUMCOMPARE(typlast))
+ OP * left = cBINOPo->op_first;
+ OP * right = left->op_sibling;
+ if ((OP_IS_NUMCOMPARE(left->op_type) &&
+ (left->op_flags & OPf_PARENS) == 0) ||
+ (OP_IS_NUMCOMPARE(right->op_type) &&
+ (right->op_flags & OPf_PARENS) == 0))
if (ckWARN(WARN_PRECEDENCE))
Perl_warner(aTHX_ packWARN(WARN_PRECEDENCE),
"Possible precedence problem on bitwise %c operator",
This expression is actually equivalent to C<$x & ($y == 0)>, due to the
higher precedence of C<==>. This is probably not what you want. (If you
-really meant to write this, disable the warning, or, better, write
-C<$x & ($y == 0 ? 1 : 0)>). (This warning might also be produced when you
-use the bitwise exclusive or, C<^>. Consider using the low-precedence
-C<xor> operator instead. See L<perlop>.)
+really meant to write this, disable the warning, or, better, put the
+parentheses explicitly and write C<$x & ($y == 0)>).
=item Possible unintended interpolation of %s in string