Mercurial > hg > CbC > CbC_gcc
comparison 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 |
comparison
equal
deleted
inserted
replaced
130:e108057fa461 | 132:d34655255c78 |
---|---|
1 /* Source locations within string literals. | 1 /* Source locations within string literals. |
2 Copyright (C) 2016-2017 Free Software Foundation, Inc. | 2 Copyright (C) 2016-2018 Free Software Foundation, Inc. |
3 | 3 |
4 This file is part of GCC. | 4 This file is part of GCC. |
5 | 5 |
6 GCC is free software; you can redistribute it and/or modify it under | 6 GCC is free software; you can redistribute it and/or modify it under |
7 the terms of the GNU General Public License as published by the Free | 7 the terms of the GNU General Public License as published by the Free |
72 int m_caret_idx; | 72 int m_caret_idx; |
73 int m_start_idx; | 73 int m_start_idx; |
74 int m_end_idx; | 74 int m_end_idx; |
75 }; | 75 }; |
76 | 76 |
77 /* Functions for emitting a warning about a format string. */ | 77 /* A bundle of state for emitting a diagnostic relating to a format string. */ |
78 | 78 |
79 extern bool format_warning_va (const substring_loc &fmt_loc, | 79 class format_string_diagnostic_t |
80 location_t param_loc, | 80 { |
81 const char *corrected_substring, | 81 public: |
82 int opt, const char *gmsgid, va_list *ap) | 82 format_string_diagnostic_t (const substring_loc &fmt_loc, |
83 ATTRIBUTE_GCC_DIAG (5,0); | 83 const range_label *fmt_label, |
84 location_t param_loc, | |
85 const range_label *param_label, | |
86 const char *corrected_substring); | |
84 | 87 |
85 extern bool format_warning_at_substring (const substring_loc &fmt_loc, | 88 /* Functions for emitting a warning about a format string. */ |
86 location_t param_loc, | 89 |
87 const char *corrected_substring, | 90 bool emit_warning_va (int opt, const char *gmsgid, va_list *ap) const |
88 int opt, const char *gmsgid, ...) | 91 ATTRIBUTE_GCC_DIAG (3, 0); |
89 ATTRIBUTE_GCC_DIAG (5,0); | 92 |
93 bool emit_warning_n_va (int opt, unsigned HOST_WIDE_INT n, | |
94 const char *singular_gmsgid, | |
95 const char *plural_gmsgid, va_list *ap) const | |
96 ATTRIBUTE_GCC_DIAG (4, 0) ATTRIBUTE_GCC_DIAG (5, 0); | |
97 | |
98 bool emit_warning (int opt, const char *gmsgid, ...) const | |
99 ATTRIBUTE_GCC_DIAG (3, 4); | |
100 | |
101 bool emit_warning_n (int opt, unsigned HOST_WIDE_INT n, | |
102 const char *singular_gmsgid, | |
103 const char *plural_gmsgid, ...) const | |
104 ATTRIBUTE_GCC_DIAG (4, 6) ATTRIBUTE_GCC_DIAG (5, 6); | |
105 | |
106 private: | |
107 const substring_loc &m_fmt_loc; | |
108 const range_label *m_fmt_label; | |
109 location_t m_param_loc; | |
110 const range_label *m_param_label; | |
111 const char *m_corrected_substring; | |
112 }; | |
113 | |
90 | 114 |
91 /* Implementation detail, for use when implementing | 115 /* Implementation detail, for use when implementing |
92 LANG_HOOKS_GET_SUBSTRING_LOCATION. */ | 116 LANG_HOOKS_GET_SUBSTRING_LOCATION. */ |
93 | 117 |
94 extern const char *get_source_location_for_substring (cpp_reader *pfile, | 118 extern const char *get_source_location_for_substring (cpp_reader *pfile, |