class AdLint::Exam::CBuiltin::W0478

Public Class Methods

new(phase_ctxt) click to toggle source
Calls superclass method AdLint::Examination::new
# File lib/adlint/exam/c_builtin/cpp_check.rb, line 664
def initialize(phase_ctxt)
  super
  trav = phase_ctxt[:cpp_ast_traversal]
  trav.enter_object_like_define_line      += T(:check)
  trav.enter_function_like_define_line    += T(:check)
  trav.enter_va_function_like_define_line += T(:check)
end

Private Instance Methods

check(node) click to toggle source
# File lib/adlint/exam/c_builtin/cpp_check.rb, line 673
def check(node)
  if repl_list = node.replacement_list and repl_list.tokens.size > 1
    unless repl_list.may_represent_expression? ||
        repl_list.may_represent_initializer? ||
        repl_list.may_represent_block? ||
        repl_list.may_represent_do_while_zero_idiom? ||
        repl_list.may_represent_specifier_qualifier_list? ||
        repl_list.may_represent_declaration_specifiers_head?
      W(node.location)
    end
  end
end