/* Compute the number of digits in the decimal representation of an integer. */
extern int num_digits (int);
-extern char *get_cwe_url (int cwe);
-extern const char *maybe_line_and_column (int line, int col);
-
} // namespace diagnostics
#endif /* ! GCC_DIAGNOSTIC_H */
col = converted_column (s);
}
- const char *line_col = maybe_line_and_column (line, col);
+ const char *line_col = text_sink::maybe_line_and_column (line, col);
return label_text::take (build_message_string ("%s%s%s:%s", locus_cs, file,
line_col, locus_ce));
}
assert_location_text ("foo.c:42:", "foo.c", 42, 10, false);
assert_location_text ("foo.c:", "foo.c", 0, 10, false);
- diagnostics::maybe_line_and_column (INT_MAX, INT_MAX);
- diagnostics::maybe_line_and_column (INT_MIN, INT_MIN);
+ diagnostics::text_sink::maybe_line_and_column (INT_MAX, INT_MAX);
+ diagnostics::text_sink::maybe_line_and_column (INT_MIN, INT_MIN);
{
/* In order to test display columns vs byte columns, we need to create a
const lazy_digraphs *m_lazy_digraphs;
};
+extern char *get_cwe_url (int cwe);
+
} // namespace diagnostics
#endif /* ! GCC_DIAGNOSTICS_METADATA_H */
The result is a statically allocated buffer. */
const char *
-maybe_line_and_column (int line, int col)
+text_sink::maybe_line_and_column (int line, int col)
{
static char result[32];
return m_source_printing;
}
+ static const char *maybe_line_and_column (int line, int col);
+
protected:
void print_any_cwe (const diagnostic_info &diagnostic);
void print_any_rules (const diagnostic_info &diagnostic);