17#if defined(__clang__) || defined(__GNUC__)
18#define DIAG_PRINTF_FORMAT(fmt_index, first_arg) \
19 __attribute__((format(printf, fmt_index, first_arg)))
21#define DIAG_PRINTF_FORMAT(fmt_index, first_arg)
80 int line,
int col,
const char *fmt, ...)
81 DIAG_PRINTF_FORMAT(5, 6);
void diag_engine_free(struct diag_engine *engine)
Free a diagnostic engine and all its entries.
Definition diag.c:54
int diag_has_errors(struct diag_engine *engine)
Check if any errors were emitted.
Definition diag.c:223
int diag_error_count(struct diag_engine *engine)
Get the number of errors emitted.
Definition diag.c:228
void diag_emit(struct diag_engine *engine, enum diag_severity severity, int line, int col, const char *fmt,...) DIAG_PRINTF_FORMAT(5
Emit a diagnostic message.
struct diag_engine * diag_engine_new(const char *filename, const char *source, long source_len)
Create a new diagnostic engine.
Definition diag.c:30
diag_severity
Definition diag.h:29
void void diag_print_all(struct diag_engine *engine, FILE *stream)
Print all accumulated diagnostics to a stream. Uses ANSI colors if stream is a terminal.
Definition diag.c:160