class AdLint::Exam::CBuiltin::W0628

Public Class Methods

new(phase_ctxt) click to toggle source
Calls superclass method AdLint::Examination::new
# File lib/adlint/exam/c_builtin/ld_check.rb, line 155
def initialize(phase_ctxt)
  super
  phase_ctxt[:ld_function_traversal].on_definition += T(:check)
  @xref_graph = phase_ctxt[:ld_xref_graph]
end

Private Instance Methods

check(fun) click to toggle source
# File lib/adlint/exam/c_builtin/ld_check.rb, line 162
def check(fun)
  unless fun.name == "main"
    if @xref_graph.direct_referrers_of(fun).empty?
      W(fun.location, fun.signature)
    end
  end
end