39static std::set<int> disabled;
41static bool warn =
true;
42static bool info =
false;
71 enabled = disabled.find (type) == disabled.end ();
72 disabled.insert (type);
79 const bool is_warn = !is_info &&
W_FIRST <= type && type <=
W_LAST;
80 const bool is_error = !is_info && !is_warn;
82 if (is_warn && (!warn || disabled.end () != disabled.find (type))) {
87 if (is_info && !info) {
96 if (token && token->
file)
100 std::fprintf (
stderr,
"Error %-3d: ", type);
102 std::fprintf (
stderr,
"Warning %-3d: ", type);
104 std::fprintf (
stderr,
"Note %-3d: ", type);
110 std::vfprintf (
stderr, fmt, va);
118 std::FILE*
const ftok = token ? std::fopen (token->
file,
"r") : 0;
125 for (
i = 0;
i < token->
line; ++
i) {
126 if (0 == std::fgets (
line, 1024, ftok)) {
133 std::fputs (
"\t\t",
stderr);
135 std::fputs (
"\t\t",
stderr);
142 std::fputc (
line [
i] ==
'\t' ?
'\t' :
' ',
stderr);
144 for (
unsigned j = 0;
j < token->
name.size (); ++
j)
147 std::fputc (
'\n',
stderr);
#define va_start(va, name)
bool issue_diag(int type, bool, const Scanner::token_t *token, const char *fmt,...)