/* Initialize the diagnostic message outputting machinery. */ void diagnostic_initialize (diagnostic_context *context, int n_opts) { int i; /* Allocate a basic pretty-printer. Clients will replace this a much more elaborated pretty-printer if they wish. */ context->printer = XNEW (pretty_printer); new (context->printer) pretty_printer (); memset (context->diagnostic_count, 0, sizeof context->diagnostic_count); context->warning_as_error_requested = false; context->n_opts = n_opts; context->classify_diagnostic = XNEWVEC (diagnostic_t, n_opts); for (i = 0; i < n_opts; i++) context->classify_diagnostic[i] = DK_UNSPECIFIED; context->show_caret = false; diagnostic_set_caret_max_width (context, pp_line_cutoff (context->printer)); for (i = 0; i < rich_location::STATICALLY_ALLOCATED_RANGES; i++) context->caret_chars[i] = '^'; context->show_option_requested = false; context->abort_on_error = false; context->show_column = false; context->pedantic_errors = false; context->permissive = false; context->opt_permissive = 0; context->fatal_errors = false; context->dc_inhibit_warnings = false; context->dc_warn_system_headers = false; context->max_errors = 0; context->internal_error = NULL; diagnostic_starter (context) = default_diagnostic_starter; context->start_span = default_diagnostic_start_span_fn; diagnostic_finalizer (context) = default_diagnostic_finalizer; context->option_enabled = NULL; context->option_state = NULL; context->option_name = NULL; context->last_location = UNKNOWN_LOCATION; context->last_module = 0; context->x_data = NULL; context->lock = 0; context->inhibit_notes_p = false; context->colorize_source_p = false; context->show_ruler_p = false; context->parseable_fixits_p = false; context->edit_context_ptr = NULL; }
/* Initialize the diagnostic message outputting machinery. */ void diagnostic_initialize (diagnostic_context *context, int n_opts) { int i; /* Allocate a basic pretty-printer. Clients will replace this a much more elaborated pretty-printer if they wish. */ context->printer = XNEW (pretty_printer); pp_construct (context->printer, NULL, 0); /* By default, diagnostics are sent to stderr. */ context->printer->buffer->stream = stderr; /* By default, we emit prefixes once per message. */ context->printer->wrapping.rule = DIAGNOSTICS_SHOW_PREFIX_ONCE; memset (context->diagnostic_count, 0, sizeof context->diagnostic_count); context->some_warnings_are_errors = false; context->warning_as_error_requested = false; context->n_opts = n_opts; context->classify_diagnostic = XNEWVEC (diagnostic_t, n_opts); for (i = 0; i < n_opts; i++) context->classify_diagnostic[i] = DK_UNSPECIFIED; context->show_caret = false; diagnostic_set_caret_max_width (context, pp_line_cutoff (context->printer)); context->show_option_requested = false; context->abort_on_error = false; context->show_column = false; context->pedantic_errors = false; context->permissive = false; context->opt_permissive = 0; context->fatal_errors = false; context->dc_inhibit_warnings = false; context->dc_warn_system_headers = false; context->max_errors = 0; context->internal_error = NULL; diagnostic_starter (context) = default_diagnostic_starter; diagnostic_finalizer (context) = default_diagnostic_finalizer; context->option_enabled = NULL; context->option_state = NULL; context->option_name = NULL; context->last_location = UNKNOWN_LOCATION; context->last_module = 0; context->x_data = NULL; context->lock = 0; context->inhibit_notes_p = false; }