class AdLint::Exam::CBuiltin::W0037

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 922
def initialize(phase_ctxt)
  super
  trav = phase_ctxt[:cc1_ast_traversal]
  trav.enter_struct_specifier += T(:enter_struct_specifier)
  trav.leave_struct_specifier += T(:leave_struct_specifier)
  trav.enter_union_specifier  += T(:enter_union_specifier)
  trav.leave_union_specifier  += T(:leave_union_specifier)
  @nest_level = 0
end

Private Instance Methods

enter_struct_specifier(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 933
def enter_struct_specifier(node)
  @nest_level += 1
  W(node.location) if @nest_level == 16
end
enter_union_specifier(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 942
def enter_union_specifier(node)
  @nest_level += 1
  W(node.location) if @nest_level == 16
end
leave_struct_specifier(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 938
def leave_struct_specifier(node)
  @nest_level -= 1
end
leave_union_specifier(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 947
def leave_union_specifier(node)
  @nest_level -= 1
end