class AdLint::Exam::CBuiltin::W0794

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 19729
def initialize(phase_ctxt)
  super
  @interp = phase_ctxt[:cc1_interpreter]
  @interp.on_shift_expr_evaled += T(:check)
end

Private Instance Methods

check(expr, lhs_var, *) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 19736
def check(expr, lhs_var, *)
  case expr.operator.type
  when "<<", "<<="
    unless constant_expression?(expr.lhs_operand)
      W(expr.location) if lhs_var.type.signed?
    end
  end
end
interpreter() click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 19745
def interpreter
  @interp
end