1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
//==--- DiagnosticLexKinds.def - liblex diagnostics -------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//
// Lexer Diagnostics
//===----------------------------------------------------------------------===//
#ifdef LEXSTART
__LEXSTART = DIAG_START_LEX,
#undef LEXSTART
#endif
DIAG(null_in_string, WARNING,
"null character(s) preserved in string literal")
DIAG(null_in_char , WARNING,
"null character(s) preserved in character literal")
DIAG(null_in_file , WARNING,
"null character ignored")
DIAG(warn_nested_block_comment, WARNING,
"'/*' within block comment")
DIAG(escaped_newline_block_comment_end, WARNING,
"escaped newline between */ characters at block comment end")
DIAG(backslash_newline_space, WARNING,
"backslash and newline separated by space")
// Trigraphs.
DIAG(trigraph_ignored, WARNING, "trigraph ignored")
DIAG(trigraph_ignored_block_comment, WARNING,
"ignored trigraph would end block comment")
DIAG(trigraph_ends_block_comment, WARNING,
"trigraph ends block comment")
DIAG(trigraph_converted, WARNING,
"trigraph converted to '%0' character")
DIAG(ext_multi_line_bcpl_comment, EXTENSION,
"multi-line // comment")
DIAG(ext_bcpl_comment, EXTENSION,
"// comments are not allowed in this language")
DIAG(ext_no_newline_eof, EXTENSION,
"no newline at end of file")
DIAG(ext_backslash_newline_eof, EXTENSION,
"backslash-newline at end of file")
DIAG(ext_dollar_in_identifier, EXTENSION,
"'$' in identifier")
DIAG(charize_microsoft_ext, EXTENSION,
"@# is a microsoft extension")
DIAG(ext_token_used, EXTENSION,
"extension used")
DIAG(err_unterminated_string, ERROR,
"missing terminating \" character")
DIAG(err_unterminated_char, ERROR,
"missing terminating ' character")
DIAG(err_empty_character, ERROR,
"empty character constant")
DIAG(err_unterminated_block_comment, ERROR,
"unterminated /* comment")
DIAG(err_invalid_character_to_charify, ERROR,
"invalid argument to convert to character")
// Literal
DIAG(ext_nonstandard_escape, EXTENSION,
"use of non-standard escape character '\\%0'")
DIAG(ext_unknown_escape, EXTENSION,
"unknown escape sequence '\\%0'")
DIAG(err_hex_escape_no_digits, ERROR,
"\\x used with no following hex digits")
DIAG(err_invalid_decimal_digit, ERROR,
"invalid digit '%0' in decimal constant")
DIAG(err_invalid_binary_digit, ERROR,
"invalid digit '%0' in binary constant")
DIAG(err_invalid_octal_digit, ERROR,
"invalid digit '%0' in octal constant")
DIAG(err_invalid_suffix_integer_constant, ERROR,
"invalid suffix '%0' on integer constant")
DIAG(err_invalid_suffix_float_constant, ERROR,
"invalid suffix '%0' on floating constant")
DIAG(warn_extraneous_wide_char_constant, WARNING,
"extraneous characters in wide character constant ignored")
DIAG(warn_char_constant_too_large, WARNING,
"character constant too long for its type")
DIAG(err_exponent_has_no_digits, ERROR,
"exponent has no digits")
DIAG(ext_imaginary_constant, EXTENSION,
"imaginary constants are an extension")
DIAG(err_hexconstant_requires_exponent, ERROR,
"hexadecimal floating constants require an exponent")
DIAG(ext_hexconstant_invalid, EXTENSION,
"hexadecimal floating constants are a C99 feature")
DIAG(ext_binary_literal, EXTENSION,
"binary integer literals are an extension")
DIAG(err_pascal_string_too_long, ERROR,
"Pascal string is too long")
DIAG(warn_octal_escape_too_large, EXTWARN,
"octal escape sequence out of range")
DIAG(warn_hex_escape_too_large, EXTWARN,
"hex escape sequence out of range")
//===----------------------------------------------------------------------===//
// Preprocessor Diagnostics
//===----------------------------------------------------------------------===//
DIAG(pp_hash_warning, WARNING,
"#warning%0")
DIAG(pp_include_next_in_primary, WARNING,
"#include_next in primary source file")
DIAG(pp_include_next_absolute_path, WARNING,
"#include_next with absolute path")
DIAG(ext_c99_whitespace_required_after_macro_name, WARNING,
"ISO C99 requires whitespace after the macro name")
DIAG(pp_pragma_once_in_main_file, WARNING,
"#pragma once in main file")
DIAG(pp_pragma_sysheader_in_main_file, WARNING,
"#pragma system_header ignored in main file")
DIAG(pp_poisoning_existing_macro, WARNING,
"poisoning existing macro")
DIAG(pp_out_of_date_dependency, WARNING,
"current file is older than dependency %0")
DIAG(pp_undef_builtin_macro, WARNING,
"undefining builtin macro")
DIAG(pp_redef_builtin_macro, WARNING,
"redefining builtin macro")
DIAG(pp_invalid_string_literal, WARNING,
"invalid string literal, ignoring final '\\'")
DIAG(warn_pp_expr_overflow, WARNING,
"integer overflow in preprocessor expression")
DIAG(warn_pp_convert_lhs_to_positive, WARNING,
"left side of operator converted from negative value to unsigned: %0")
DIAG(warn_pp_convert_rhs_to_positive, WARNING,
"right side of operator converted from negative value to unsigned: %0")
DIAG(ext_pp_import_directive, EXTENSION,
"#import is a language extension")
DIAG(ext_pp_ident_directive, EXTENSION,
"#ident is a language extension")
DIAG(ext_pp_include_next_directive, EXTENSION,
"#include_next is a language extension")
DIAG(ext_pp_warning_directive, EXTENSION,
"#warning is a language extension")
DIAG(ext_pp_extra_tokens_at_eol, EXTENSION,
"extra tokens at end of %0 directive")
DIAG(ext_pp_comma_expr, EXTENSION,
"comma operator in operand of #if")
DIAG(ext_pp_bad_vaargs_use, EXTENSION,
"__VA_ARGS__ can only appear in the expansion of a C99 variadic macro")
DIAG(ext_pp_macro_redef, EXTENSION,
"%0 macro redefined")
DIAG(ext_variadic_macro, EXTENSION,
"variadic macros were introduced in C99")
DIAG(ext_named_variadic_macro, EXTENSION,
"named variadic macros are a GNU extension")
DIAG(ext_embedded_directive, EXTENSION,
"embedding a directive within macro arguments is not portable")
DIAG(ext_missing_varargs_arg, EXTENSION,
"varargs argument missing, but tolerated as an extension")
DIAG(ext_empty_fnmacro_arg, EXTENSION,
"empty macro arguments were standardized in C99")
DIAG(ext_pp_base_file, EXTENSION,
"__BASE_FILE__ is a language extension")
DIAG(ext_pp_include_level, EXTENSION,
"__INCLUDE_LEVEL__ is a language extension")
DIAG(ext_pp_timestamp, EXTENSION,
"__TIMESTAMP__ is a language extension")
DIAG(err_pp_invalid_directive, ERROR,
"invalid preprocessing directive")
DIAG(err_pp_hash_error, ERROR,
"#error%0")
DIAG(err_pp_file_not_found, ERROR,
"'%0' file not found")
DIAG(err_pp_empty_filename, ERROR,
"empty filename")
DIAG(err_pp_include_too_deep, ERROR,
"#include nested too deeply")
DIAG(err_pp_expects_filename, ERROR,
"expected \"FILENAME\" or <FILENAME>")
DIAG(err_pp_macro_not_identifier, ERROR,
"macro names must be identifiers")
DIAG(err_pp_missing_macro_name, ERROR,
"macro name missing")
DIAG(err_pp_missing_rparen_in_macro_def, ERROR,
"missing ')' in macro parameter list")
DIAG(err_pp_invalid_tok_in_arg_list, ERROR,
"invalid token in macro parameter list")
DIAG(err_pp_expected_ident_in_arg_list, ERROR,
"expected identifier in macro parameter list")
DIAG(err_pp_expected_comma_in_arg_list, ERROR,
"expected comma in macro parameter list")
DIAG(err_pp_duplicate_name_in_arg_list, ERROR,
"duplicate macro parameter name %0")
DIAG(err_pp_stringize_not_parameter, ERROR,
"'#' is not followed by a macro parameter")
DIAG(err_pp_malformed_ident, ERROR,
"invalid #ident directive")
DIAG(err_pp_unterminated_conditional, ERROR,
"unterminated conditional directive")
DIAG(pp_err_else_after_else, ERROR,
"#else after #else")
DIAG(pp_err_elif_after_else, ERROR,
"#elif after #else")
DIAG(pp_err_else_without_if, ERROR,
"#else without #if")
DIAG(pp_err_elif_without_if, ERROR,
"#elif without #if")
DIAG(err_pp_endif_without_if, ERROR,
"#endif without #if")
DIAG(err_pp_expected_value_in_expr, ERROR,
"expected value in expression")
DIAG(err_pp_missing_val_before_operator, ERROR,
"missing value before operator")
DIAG(err_pp_expected_rparen, ERROR,
"expected ')' in preprocessor expression")
DIAG(err_pp_expected_eol, ERROR,
"expected end of line in preprocessor expression")
DIAG(err_pp_defined_requires_identifier, ERROR,
"operator 'defined' requires an identifier")
DIAG(err_pp_missing_rparen, ERROR,
"missing ')' after 'defined'")
DIAG(err_pp_colon_without_question, ERROR,
"':' without preceding '?'")
DIAG(err_pp_division_by_zero, ERROR,
"division by zero in preprocessor expression")
DIAG(err_pp_remainder_by_zero, ERROR,
"remainder by zero in preprocessor expression")
DIAG(err_pp_expr_bad_token_binop, ERROR,
"token is not a valid binary operator in a preprocessor subexpression")
DIAG(err_pp_expr_bad_token_start_expr, ERROR,
"invalid token at start of a preprocessor expression")
DIAG(err_pp_invalid_poison, ERROR,
"can only poison identifier tokens")
DIAG(err_pp_used_poisoned_id, ERROR,
"attempt to use a poisoned identifier")
DIAG(err__Pragma_malformed, ERROR,
"_Pragma takes a parenthesized string literal")
DIAG(err_pragma_comment_malformed, ERROR,
"pragma comment requires parenthesized identifier and optional string")
DIAG(err_pragma_comment_unknown_kind, ERROR,
"unknown kind of pragma comment")
DIAG(err_defined_macro_name, ERROR,
"'defined' cannot be used as a macro name")
DIAG(err_paste_at_start, ERROR,
"'##' cannot appear at start of macro expansion")
DIAG(err_paste_at_end, ERROR,
"'##' cannot appear at end of macro expansion")
DIAG(ext_paste_comma, EXTENSION,
"Use of comma pasting extension is non-portable")
DIAG(err_unterm_macro_invoc, ERROR,
"unterminated function-like macro invocation")
DIAG(err_too_many_args_in_macro_invoc, ERROR,
"too many arguments provided to function-like macro invocation")
DIAG(err_too_few_args_in_macro_invoc, ERROR,
"too few arguments provided to function-like macro invocation")
DIAG(err_pp_bad_paste, ERROR,
"pasting formed '%0', an invalid preprocessing token")
DIAG(err_pp_operator_used_as_macro_name, ERROR,
"C++ operator '%0' cannot be used as a macro name")
DIAG(err_pp_illegal_floating_literal, ERROR,
"floating point literal in preprocessor expression")
DIAG(err_pp_line_requires_integer, ERROR,
"#line directive requires a positive integer argument")
DIAG(err_pp_line_invalid_filename, ERROR,
"invalid filename for #line directive")
DIAG(err_pp_linemarker_requires_integer, ERROR,
"line marker directive requires a positive integer argument")
DIAG(err_pp_linemarker_invalid_filename, ERROR,
"invalid filename for line marker directive")
DIAG(err_pp_linemarker_invalid_flag, ERROR,
"invalid flag line marker directive")
DIAG(err_pp_linemarker_invalid_pop, ERROR,
"invalid line marker flag '2': cannot pop empty include stack")
DIAG(ext_pp_line_too_big, EXTENSION,
"C requires #line number to be less than %0, allowed as extension")
|