class AdLint::Exam::CBuiltin::W1053
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 21082 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 21089 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] if constant_expression?(arg_expr) W(arg_expr.location) unless arg_var.type.enum? end end end
interpreter()
click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 21101 def interpreter @interp end