4 # define CTU_EVENT(name, ...)
12 .severity = eSeverityFatal,
14 .brief =
"No source files",
15 .description =
"No source files were provided to the compiler",
19 .severity = eSeverityFatal,
21 .brief =
"Failed to open source file",
22 .description =
"Failed to open a required source file required by the compiler",
26 .severity = eSeverityFatal,
28 .brief =
"No file extension",
29 .description =
"The compiler was unable to identify the language of a source file due to the"
30 " lack of a file extension",
33 CTU_EVENT(FailedToCreateOutputDirectory, {
34 .severity = eSeverityFatal,
36 .brief =
"Failed to create output directory",
37 .description =
"The compiler was unable to create the output directory",
41 .severity = eSeverityFatal,
43 .brief =
"Failed to create output file",
44 .description =
"The compiler was unable to create the output file",
48 .severity = eSeverityFatal,
50 .brief =
"Failed to write output file",
51 .description =
"The compiler was unable to write to the output file",
55 .severity = eSeverityInternal,
57 .brief =
"Extension conflict",
58 .description =
"Multiple languages enabled in the compiler register the same file extension",
62 .severity = eSeverityInternal,
64 .brief =
"Failed to init parser",
65 .description =
"The parser failed to initialise",
69 .severity = eSeverityInternal,
71 .brief =
"Failed to scan",
72 .description =
"The scanner failed to scan the source file due to internal errors",
76 .severity = eSeverityFatal,
78 .brief =
"Failed to parse",
79 .description =
"The parser failed to parse the source file",
83 .severity = eSeverityInternal,
85 .brief =
"Internal parser error",
86 .description =
"The parser encountered an internal error",
90 .severity = eSeverityFatal,
92 .brief =
"Uninitialized value used",
93 .description =
"An uninitialized value was used in a compile time context",
97 .severity = eSeverityFatal,
99 .brief =
"Divide by zero",
100 .description =
"A divide by zero was encountered in a compile time context",
104 .severity = eSeverityFatal,
106 .brief =
"Modulo by zero",
107 .description =
"A modulo by zero was encountered in a compile time context",
111 .severity = eSeverityFatal,
113 .brief =
"Invalid string escape",
114 .description =
"An invalid string escape was encountered while parsing",
118 .severity = eSeverityFatal,
120 .brief =
"Invalid integer literal",
121 .description =
"An invalid integer literal was encountered while parsing",
125 .severity = eSeverityFatal,
127 .brief =
"Symbol shadowed",
128 .description =
"A symbol was shadowed by another symbol",
132 .severity = eSeverityFatal,
134 .brief =
"Variable not found",
135 .description =
"A variable was not found in the current scope",
139 .severity = eSeverityFatal,
141 .brief =
"Function not found",
142 .description =
"A function was not found in the current scope",
146 .severity = eSeverityFatal,
148 .brief =
"Type not found",
149 .description =
"A type was not found in the current scope",
153 .severity = eSeverityFatal,
155 .brief =
"Field not found",
156 .description =
"A field was not found in within a type",
160 .severity = eSeverityWarn,
162 .brief =
"Attrib not found",
163 .description =
"An attribute of the current name was not found, "
164 "or is not supported by this version of the compiler",
168 .severity = eSeverityFatal,
170 .brief =
"Invalid indirection",
171 .description =
"The wrong indirection was used when accessing a value",
175 .severity = eSeverityFatal,
177 .brief =
"Invalid index",
178 .description =
"An indexing operation was invalid",
182 .severity = eSeverityFatal,
184 .brief =
"Symbol not visible",
185 .description =
"A symbol was not visible in the current scope, perhaps due to privacy specifiers",
189 .severity = eSeverityFatal,
191 .brief =
"Symbol not found",
192 .description =
"A symbol was not found in the current scope",
196 .severity = eSeverityFatal,
198 .brief =
"Malformed type name",
199 .description =
"A type name was malformed and could not be resolved to a type",
203 .severity = eSeverityFatal,
205 .brief =
"Mutation of const",
206 .description =
"A const value was mutated",
210 .severity = eSeverityWarn,
212 .brief =
"Expression has no effect",
213 .description =
"An expression has no effect",
217 .severity = eSeverityFatal,
219 .brief =
"Incorrect parameter count",
220 .description =
"A function was called with an incorrect number of parameters",
224 .severity = eSeverityFatal,
226 .brief =
"Incorrect parameter type",
227 .description =
"A function was called with an incorrect parameter type",
231 .severity = eSeverityFatal,
233 .brief =
"Duplicate attribute",
234 .description =
"A duplicate attribute was found on a declaration",
238 .severity = eSeverityFatal,
240 .brief =
"Invalid attribute application",
241 .description =
"An attribute was applied to the incorrect kind of declaration",
245 .severity = eSeverityFatal,
247 .brief =
"Malformed attribute",
248 .description =
"An attribute or its arguments were malformed",
252 .severity = eSeverityWarn,
254 .brief =
"Unimplemented attribute",
255 .description =
"An attribute is not implemented",
259 .severity = eSeverityFatal,
261 .brief =
"Invalid literal type",
262 .description =
"A literal was of an invalid type",
266 .severity = eSeverityFatal,
268 .brief =
"Invalid binary operation",
269 .description =
"A binary operations operands were not compatible for the operation",
273 .severity = eSeverityFatal,
275 .brief =
"Invalid unary operation",
276 .description =
"A unary operations operand was not compatible for the operation",
280 .severity = eSeverityFatal,
282 .brief =
"Invalid initializer",
283 .description =
"An aggregate initializer was invalid,"
284 " either due to an invalid field value or an ambiguous implicit type",
288 .severity = eSeverityFatal,
290 .brief =
"Invalid control flow",
291 .description =
"A control flow statement was nonsensical in the current context."
292 " a break or continue outside of a loop or a goto with a non-local label.",
296 .severity = eSeverityFatal,
298 .brief =
"Circular import",
299 .description =
"A translation unit imported itself, note that multural recursion between translation units is supported",
303 .severity = eSeverityFatal,
305 .brief =
"Import not found",
306 .description =
"An import was unable to be resolved",
310 .severity = eSeverityFatal,
312 .brief =
"Import shadowed",
313 .description =
"Importing an external translation units symbols would shadow an existing symbol in the current scope",
317 .severity = eSeverityFatal,
319 .brief =
"Invalid enum underlying type",
320 .description =
"The user specified underlying type of an enum was invalid",
324 .severity = eSeverityFatal,
326 .brief =
"Duplicate field",
327 .description =
"A duplicate field was found in an aggregate or enumeration",
331 .severity = eSeverityFatal,
333 .brief =
"Invalid function signature",
334 .description =
"A function signature was invalid, parameters cannot be a unit type",
338 .severity = eSeverityFatal,
340 .brief =
"Invalid array size",
341 .description =
"An array size was invalid, either due to a non-integer size or a negative size,"
342 " the size of an array must be statically known at compile time",
346 .severity = eSeverityFatal,
348 .brief =
"Invalid variable type",
349 .description =
"A variable was declared with an invalid type,"
350 " either a unit type or a type with an invalid storage class",
354 .severity = eSeverityFatal,
356 .brief =
"Cyclic dependency",
357 .description =
"Static evaluation of a value encountered a cyclic dependency",
361 .severity = eSeverityFatal,
363 .brief =
"Imported declaration has implementation",
364 .description =
"A declaration was imported but has a declaration with an implementation in the current translation unit",
368 .severity = eSeverityFatal,
370 .brief =
"Entry not function",
371 .description =
"The entry point of the program was not a function",
375 .severity = eSeverityFatal,
377 .brief =
"Entry missing body",
378 .description =
"The entry point of the program was missing an implementation",
382 .severity = eSeverityFatal,
384 .brief =
"Multiple entry points",
385 .description =
"A program was declared with multiple entry points of the same type"
386 " a program can only have one entry point of each type",
390 .severity = eSeverityFatal,
392 .brief =
"Return type mismatch",
393 .description =
"A function returned a value of a different type than its return type"
394 " a return statement must return a value that can be implicitly cast to the functions declared return type",
398 .severity = eSeverityWarn,
400 .brief =
"Deprecated",
401 .description =
"A deprecated feature was used",
405 .severity = eSeverityFatal,
407 .brief =
"May not return",
408 .description =
"A function with a return value may not always return a value",
412 .severity = eSeverityFatal,
414 .brief =
"Recursive eval",
415 .description =
"Static evaluation of a value would recurse infinitely",
419 .severity = eSeverityFatal,
421 .brief =
"Infinite sized type",
422 .description =
"A type was infinitely sized, indicating a recursive type",
426 .severity = eSeverityFatal,
428 .brief =
"Invalid type",
429 .description =
"A type was invalid due to invalid recursion",
433 .severity = eSeverityWarn,
435 .brief =
"Worrying cast",
436 .description =
"A cast between types that may truncate, lose precision, or lose type information",
440 .severity = eSeverityFatal,
442 .brief =
"Invalid cast",
443 .description =
"A cast between types was invalid",
447 .severity = eSeverityFatal,
449 .brief =
"Failed to identify language",
450 .description =
"The compiler was unable to identify the language of a source file",
454 .severity = eSeverityWarn,
456 .brief =
"Ignored mangling",
457 .description =
"A symbol with hidden linkage has a mangled name, which is ignored",
461 .severity = eSeverityFatal,
463 .brief =
"Unknown token",
464 .description =
"The scanner encountered an unknown token",
468 .severity = eSeverityFatal,
470 .brief =
"Syntax error",
471 .description =
"The parser encountered a syntax error",
475 .severity = eSeverityFatal,
477 .brief =
"Source and header both need to be specified",
479 "When generating C output files it is invalid to specify only "
480 "a source or header file, either both or neither must be specified",
484 .severity = eSeverityFatal,
486 .brief =
"Tool expects exactly one source file",
488 "The tool expects exactly one source file, but multiple were provided",
492 .severity = eSeverityWarn,
494 .brief =
"Evaluation of an expression failed",
496 "The compiler was unable to evaluate an expression, "
497 "this may be due to an unsupported feature or a bug in the compiler.",
501 .severity = eSeverityWarn,
503 .brief =
"Inexact integer division",
505 "An integer division was not exact, "
506 "This behaviour is not consistent between languages or compiler versions.",
510 .severity = eSeverityFatal,
512 .brief =
"Shift by negative",
514 "A bit shift by a negative amount was encountered.",
518 .severity = eSeverityFatal,
520 .brief =
"Integer overflow",
522 "An integer overflow was encountered.",
526 .severity = eSeverityFatal,
528 .brief =
"Invalid float literal",
530 "Invalid floating point literal value.",
534 .severity = eSeverityFatal,
536 .brief =
"Invalid file path",
538 "The file path was invalid.",
542 .severity = eSeverityFatal,
544 .brief =
"Module conflict",
546 "A module with the same name already exists.",
550 .severity = eSeverityFatal,
552 .brief =
"Language driver conflict",
554 "A language driver with the same name already exists.",
558 .severity = eSeverityFatal,
560 .brief =
"Plugin conflict",
562 "A plugin with the same name already exists.",
566 .severity = eSeverityFatal,
568 .brief =
"Target conflict",
570 "A target with the same name already exists.",
574 .severity = eSeverityFatal,
576 .brief =
"Dynamic loading disabled",
578 "Dynamic loading is disabled in this distribution of cthulhu.",
582 .severity = eSeveritySorry,
584 .brief =
"Unimplemented",
586 "This feature has not yet been implemented.",
590 .severity = eSeverityFatal,
592 .brief =
"Command line invalid",
594 "The command line arguments were invalid.",
598 .severity = eSeverityFatal,
600 .brief =
"Invalid target",
602 "The target was invalid.",
606 .severity = eSeverityInternal,
608 .brief =
"Invalid name",
610 "Non-anonymous symbol had an empty name.",
614 .severity = eSeverityFatal,
616 .brief =
"Assign to const",
618 "A const value was assigned to.",
622 .severity = eSeverityFatal,
624 .brief =
"Not an aggregate",
626 "A type was not an aggregate type.",
630 .severity = eSeverityInternal,
632 .brief =
"Assign to param",
634 "A parameter was assigned to, if a frontend allows this it must create a local copy.",
638 .severity = eSeverityFatal,
640 .brief =
"Invalid assignment",
642 "Source and destination types in assignment are incompatible.",
#define CTU_EVENT(name,...)