class AdLint::Exam::CBuiltin::W0445

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 588
def initialize(phase_ctxt)
  super
  interp = phase_ctxt[:cpp_interpreter]
  interp.on_function_like_macro_defined    += T(:check)
  interp.on_va_function_like_macro_defined += T(:check)
end

Private Instance Methods

check(define_line, macro) click to toggle source
# File lib/adlint/exam/c_builtin/cpp_check.rb, line 596
def check(define_line, macro)
  if repl_list = macro.replacement_list
    sharpsharp_op_num = 0

    repl_list.tokens.each do |pp_tok|
      if pp_tok.value == "##"
        sharpsharp_op_num += 1
      end
    end

    W(define_line.location) if sharpsharp_op_num > 1
  end
end