class AdLint::Exam::CBuiltin::W0456

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 9490
def initialize(phase_ctxt)
  super
  interp = phase_ctxt[:cc1_interpreter]
  interp.on_variable_defined          += T(:check_variable)
  interp.on_explicit_function_defined += T(:check_function)
  @target_fpath = phase_ctxt[:sources].first.fpath
end

Private Instance Methods

check_function(fun_def, fun) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 9507
def check_function(fun_def, fun)
  if fun.declared_as_extern?
    unless fun_def.location.fpath == @target_fpath
      W(fun_def.location, fun.name)
    end
  end
end
check_variable(var_def, var) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 9499
def check_variable(var_def, var)
  if var.declared_as_extern?
    unless var_def.location.fpath == @target_fpath
      W(var_def.location, var.name)
    end
  end
end