Class: AdLint::Exam::CBuiltin::W0100

Inherits:
PassiveCodeCheck show all
Defined in:
lib/adlint/exam/c_builtin/cc1_check.rb

Instance Method Summary collapse

Methods inherited from CodeCheck

message_id, message_name, #message_name, must_be_deferred?, must_be_unique?, required?

Methods inherited from AdLint::Examination

catalog, #execute, registrant_phase_class, required?

Methods included from LogUtil

#log_debug, #log_error, #log_fatal, #log_info, #log_warn

Methods included from ReportUtil

#create_context_message, #write_FL_FUNC, #write_FL_STMT, #write_FN_CALL, #write_FN_CSUB, #write_FN_CYCM, #write_FN_GOTO, #write_FN_LINE, #write_FN_NEST, #write_FN_PARA, #write_FN_PATH, #write_FN_RETN, #write_FN_STMT, #write_FN_UELS, #write_FN_UNRC, #write_FN_UNUV, #write_assignment, #write_error_message, #write_funcall, #write_fundcl, #write_fundef, #write_gvardcl, #write_include, #write_initialization, #write_labeldef, #write_literal, #write_macrodef, #write_pp_directive, #write_typedcl, #write_vardef, #write_warning_message, #write_xref_function, #write_xref_variable

Constructor Details

#initialize(phase_ctxt) ⇒ W0100

Returns a new instance of W0100.



2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
# File 'lib/adlint/exam/c_builtin/cc1_check.rb', line 2184

def initialize(phase_ctxt)
  super
  interp = phase_ctxt[:cc1_interpreter]
  interp.on_variable_defined       += T(:define_variable)
  interp.on_variable_initialized   += T(:init_variable)
  interp.on_variable_value_updated += T(:write_variable)
  interp.on_block_started          += T(:enter_block)
  interp.on_block_ended            += T(:leave_block)
  interp.on_while_stmt_started     += T(:enter_iteration)
  interp.on_while_stmt_ended       += T(:leave_iteration)
  interp.on_do_stmt_started        += T(:enter_iteration)
  interp.on_do_stmt_ended          += T(:leave_iteration)
  interp.on_for_stmt_started       += T(:enter_iteration)
  interp.on_for_stmt_ended         += T(:leave_iteration)
  interp.on_c99_for_stmt_started   += T(:enter_iteration)
  interp.on_c99_for_stmt_ended     += T(:leave_iteration)
  @var_stack = [{}]
  @iter_stmt_stack = []
end