Mercurial > hg > CbC > CbC_gcc
diff gcc/substring-locations.h @ 132:d34655255c78
update gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 10:21:07 +0900 |
parents | 84e7813d76e9 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/gcc/substring-locations.h Thu Oct 25 08:08:40 2018 +0900 +++ b/gcc/substring-locations.h Thu Oct 25 10:21:07 2018 +0900 @@ -1,5 +1,5 @@ /* Source locations within string literals. - Copyright (C) 2016-2017 Free Software Foundation, Inc. + Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of GCC. @@ -74,19 +74,43 @@ int m_end_idx; }; -/* Functions for emitting a warning about a format string. */ +/* A bundle of state for emitting a diagnostic relating to a format string. */ + +class format_string_diagnostic_t +{ + public: + format_string_diagnostic_t (const substring_loc &fmt_loc, + const range_label *fmt_label, + location_t param_loc, + const range_label *param_label, + const char *corrected_substring); + + /* Functions for emitting a warning about a format string. */ + + bool emit_warning_va (int opt, const char *gmsgid, va_list *ap) const + ATTRIBUTE_GCC_DIAG (3, 0); -extern bool format_warning_va (const substring_loc &fmt_loc, - location_t param_loc, - const char *corrected_substring, - int opt, const char *gmsgid, va_list *ap) - ATTRIBUTE_GCC_DIAG (5,0); + bool emit_warning_n_va (int opt, unsigned HOST_WIDE_INT n, + const char *singular_gmsgid, + const char *plural_gmsgid, va_list *ap) const + ATTRIBUTE_GCC_DIAG (4, 0) ATTRIBUTE_GCC_DIAG (5, 0); + + bool emit_warning (int opt, const char *gmsgid, ...) const + ATTRIBUTE_GCC_DIAG (3, 4); -extern bool format_warning_at_substring (const substring_loc &fmt_loc, - location_t param_loc, - const char *corrected_substring, - int opt, const char *gmsgid, ...) - ATTRIBUTE_GCC_DIAG (5,0); + bool emit_warning_n (int opt, unsigned HOST_WIDE_INT n, + const char *singular_gmsgid, + const char *plural_gmsgid, ...) const + ATTRIBUTE_GCC_DIAG (4, 6) ATTRIBUTE_GCC_DIAG (5, 6); + + private: + const substring_loc &m_fmt_loc; + const range_label *m_fmt_label; + location_t m_param_loc; + const range_label *m_param_label; + const char *m_corrected_substring; +}; + /* Implementation detail, for use when implementing LANG_HOOKS_GET_SUBSTRING_LOCATION. */