class AdLint::Exam::CBuiltin::W0530

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 12184
def initialize(phase_ctxt)
  super
  trav = phase_ctxt[:cc1_ast_traversal]
  trav.enter_constant_specifier       += T(:check_constant)
  trav.enter_string_literal_specifier += T(:check_string_literal)
end

Private Instance Methods

check_constant(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 12192
def check_constant(node)
  if node.constant.value =~ /\AL?'.*\\0[0-9]+.*'\z/i
    W(node.location)
  end
end
check_string_literal(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 12198
def check_string_literal(node)
  if node.literal.value =~ /\AL?".*\\0[0-9]+.*"\z/i
    W(node.location)
  end
end