class AdLint::Exam::CBuiltin::W0719
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 17385 def initialize(phase_ctxt) super @interp = phase_ctxt[:cc1_interpreter] @interp.on_shift_expr_evaled += T(:check) end
Private Instance Methods
check(expr, lhs_var, rhs_var, *)
click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 17392 def check(expr, lhs_var, rhs_var, *) if constant_expression?(expr.rhs_operand) underlying_type = lhs_var.type underlying_bit_size = scalar_value_of(underlying_type.bit_size) promoted_type = lhs_var.type.integer_promoted_type promoted_bit_size = scalar_value_of(promoted_type.bit_size) rhs_val = rhs_var.value if rhs_val.test_must_be_equal_to(underlying_bit_size).true? || rhs_val.test_must_be_greater_than(underlying_bit_size).true? and rhs_val.test_must_be_less_than(promoted_bit_size).true? W(expr.location, underlying_type.brief_image) end end end
interpreter()
click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 17408 def interpreter @interp end