class AdLint::Exam::CBuiltin::W0614

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

Private Instance Methods

check(do_stmt, ctrlexpr_val) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 14547
def check(do_stmt, ctrlexpr_val)
  unless constant_expression?(do_stmt.expression)
    if ctrlexpr_val.test_must_be_false.true?
      W(do_stmt.expression.location)
    end
  end
end
interpreter() click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 14555
def interpreter
  @interp
end