class AdLint::Exam::CBuiltin::W1061
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 21337 def initialize(phase_ctxt) super @interp = phase_ctxt[:cc1_interpreter] @interp.on_function_call_expr_evaled += T(:check) end
Private Instance Methods
check(expr, fun, arg_vars, *)
click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 21344 def check(expr, fun, arg_vars, *) args = arg_vars.zip(fun.type.parameter_types) args.each_with_index do |(arg_var, param_type), idx| next unless param_type && param_type.enum? arg_expr = expr.argument_expressions[idx] unless constant_expression?(arg_expr) unless arg_var.type.same_as?(param_type) W(arg_expr.location) end end end end
interpreter()
click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 21358 def interpreter @interp end