class AdLint::Exam::CBuiltin::W0697
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 16045 def initialize(phase_ctxt) super interp = phase_ctxt[:cc1_interpreter] interp.on_function_started += T(:start_function) interp.on_function_ended += T(:end_function) interp.on_implicit_return_evaled += M(:check_implicit_return) @cur_fun = nil end
Private Instance Methods
check_implicit_return(loc)
click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 16063 def check_implicit_return(loc) if @cur_fun && loc.in_analysis_target?(traits) unless @cur_fun.type.return_type.void? W(@cur_fun.location, @cur_fun.identifier.value) end end end
end_function(*)
click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 16059 def end_function(*) @cur_fun = nil end
start_function(fun_def, *)
click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 16055 def start_function(fun_def, *) @cur_fun = fun_def end