class AdLint::Exam::CBuiltin::W0560

Public Class Methods

new(phase_ctxt) click to toggle source
Calls superclass method AdLint::Examination::new
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 12846
def initialize(phase_ctxt)
  super
  trav = phase_ctxt[:cc1_ast_traversal]
  trav.enter_unary_arithmetic_expression += T(:check)
end

Private Instance Methods

check(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 12853
def check(node)
  if node.operator.type == "~"
    if Visitor.new.tap { |v| node.operand.accept(v) }.logical_expr_num > 0
      W(node.location)
    end
  end
end