unsigned error_count = 0;
/** Number of occurred warnings. */
unsigned warning_count = 0;
+bool show_column = true;
static const source_position_t *curr_pos = NULL;
static void print_source_position(FILE *out, const source_position_t *pos)
{
fprintf(out, "at line %u", pos->lineno);
+ if (show_column)
+ fprintf(out, ":%u", pos->colno);
if (curr_pos == NULL || curr_pos->input_name != pos->input_name)
fprintf(out, " of \"%s\"", pos->input_name);
}
static void diagnosticposvf(source_position_t const *const pos, char const *const kind, char const *const fmt, va_list ap)
{
FILE *const out = stderr;
- fprintf(out, "%s:%u: %s: ", pos->input_name, pos->lineno, kind);
+ fprintf(out, "%s:%u:", pos->input_name, pos->lineno);
+ if (show_column)
+ fprintf(out, "%u:", pos->colno);
+ fprintf(out, " %s: ", kind);
curr_pos = pos;
diagnosticvf(fmt, ap);
fputc('\n', out);