static void
emit_warning (location_t loc)
{
  source_range src_range = get_range_from_loc (line_table, loc);
  warning_at (loc, 0, "range %i:%i-%i:%i",
	      LOCATION_LINE (src_range.m_start),
	      LOCATION_COLUMN (src_range.m_start),
	      LOCATION_LINE (src_range.m_finish),
	      LOCATION_COLUMN (src_range.m_finish));
}
Exemple #2
0
/* Helper function for cb_line_change and scan_translation_unit.  */
static void
do_line_change (cpp_reader *pfile, const cpp_token *token,
		source_location src_loc, int parsing_args)
{
  if (define_queue || undef_queue)
    dump_queued_macros (pfile);

  if (token->type == CPP_EOF || parsing_args)
    return;

  maybe_print_line (src_loc);
  print.prev = 0;
  print.source = 0;

  /* Supply enough spaces to put this token in its original column,
     one space per column greater than 2, since scan_translation_unit
     will provide a space if PREV_WHITE.  Don't bother trying to
     reconstruct tabs; we can't get it right in general, and nothing
     ought to care.  Some things do care; the fault lies with them.  */
  if (!CPP_OPTION (pfile, traditional))
    {
      int spaces = LOCATION_COLUMN (src_loc) - 2;
      print.printed = 1;

      while (-- spaces >= 0)
	putc (' ', print.outf);
    }
}
static void
verify_no_columns  (diagnostic_context *context,
		    diagnostic_info *diagnostic)
{
  /* Verify that the locations have no columns. */
  location_t loc = diagnostic_location (diagnostic);
  gcc_assert (LOCATION_COLUMN (loc) == 0);

  /* We're done testing; chain up to original finalizer.  */
  gcc_assert (original_finalizer);
  original_finalizer (context, diagnostic);
}