-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patherror.c
More file actions
21 lines (16 loc) · 549 Bytes
/
Copy patherror.c
File metadata and controls
21 lines (16 loc) · 549 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "error.h"
#include <stdarg.h>
#include <stdio.h>
#include "input/sourcepos.h"
void filter_error(struct sourceposition *pos, const char *fmt, ...);
void __attribute__((__format__(__printf__, 2, 3)))
filter_error(struct sourceposition *pos, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
if (pos && pos->first_line) {
fprintf(stderr, "%s:%d.%d-%d.%d: error: ", pos->filename, pos->first_line,
pos->first_column, pos->last_line, pos->last_column);
}
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
}