class AdLint::Exam::CBuiltin::W1077

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

Private Instance Methods

check(var_dcl, *) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 21873
def check(var_dcl, *)
  type = var_dcl.type
  begin
    if type.array?
      unless type.length
        W(var_dcl.location)
        break
      end
    else
      break
    end
  end while type = type.base_type
end