Why is this an issue?

Identifies a bitwise operator used in a relational expression without parentheses, which can indicate a mistake in the intended order of operations.

How to fix it

Code examples

Noncompliant code example

module m;
  int unsigned flag1, flag2;
  initial begin
    if (flag1 & 'h1 == 'h1) begin end // Noncompliant
    if (flag2 & 'h1 == 'h1) begin end // Noncompliant
  end
endmodule

Compliant solution

module m;
  int unsigned flag1, flag2;
  initial begin
    if ((flag1 & 'h1) == 'h1) begin end // Compliant: Parentheses around the '&' expression to evaluate it first
    if (flag2 & ('h1 == 'h1)) begin end // Compliant: Parentheses around the '==' expression to silence the issue
  end
endmodule