30 lines
691 B
C
30 lines
691 B
C
#ifndef _messages_h_
|
|
#define _messages_h_
|
|
|
|
#include <stdarg.h>
|
|
#include "state.h"
|
|
#include "location.h"
|
|
|
|
#ifdef __GNUC__
|
|
# define fmtattr(archt, fmtsi, ftchk) __attribute((format(archt, fmtsi, ftchk)))
|
|
#else
|
|
# define fmtattr(a, b, c)
|
|
#endif
|
|
|
|
typedef enum
|
|
{
|
|
diag_fatal = 0,
|
|
diag_error,
|
|
diag_warning,
|
|
diag_note,
|
|
} DiagType;
|
|
|
|
void
|
|
fatal(Compiler *cm, const Location *loc, const char *s, ...) fmtattr(printf, 3, 4);
|
|
void
|
|
error(Compiler *cm, const Location *loc, const char *s, ...) fmtattr(printf, 3, 4);
|
|
void
|
|
warning(Compiler *cm, const Location *loc, const char *s, ...) fmtattr(printf, 3, 4);
|
|
void
|
|
note(Compiler *cm, const Location *loc, const char *s, ...) fmtattr(printf, 3, 4);
|
|
#endif
|