Cthulhu  0.2.10
Cthulhu compiler collection
events.inc
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-3.0-only
2 
3 #ifndef CTU_EVENT
4 # define CTU_EVENT(name, ...)
5 #endif
6 
10 
11 CTU_EVENT(NoSourceFiles, {
12  .severity = eSeverityFatal,
13  .id = "M0001",
14  .brief = "No source files",
15  .description = "No source files were provided to the compiler",
16 })
17 
18 CTU_EVENT(FailedToOpenSourceFile, {
19  .severity = eSeverityFatal,
20  .id = "M0002",
21  .brief = "Failed to open source file",
22  .description = "Failed to open a required source file required by the compiler",
23 })
24 
25 CTU_EVENT(NoFileExtension, {
26  .severity = eSeverityFatal,
27  .id = "M0003",
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",
31 })
32 
33 CTU_EVENT(FailedToCreateOutputDirectory, {
34  .severity = eSeverityFatal,
35  .id = "M0004",
36  .brief = "Failed to create output directory",
37  .description = "The compiler was unable to create the output directory",
38 })
39 
40 CTU_EVENT(FailedToCreateOutputFile, {
41  .severity = eSeverityFatal,
42  .id = "M0005",
43  .brief = "Failed to create output file",
44  .description = "The compiler was unable to create the output file",
45 })
46 
47 CTU_EVENT(FailedToWriteOutputFile, {
48  .severity = eSeverityFatal,
49  .id = "M0006",
50  .brief = "Failed to write output file",
51  .description = "The compiler was unable to write to the output file",
52 })
53 
54 CTU_EVENT(ExtensionConflict, {
55  .severity = eSeverityInternal,
56  .id = "M0007",
57  .brief = "Extension conflict",
58  .description = "Multiple languages enabled in the compiler register the same file extension",
59 })
60 
61 CTU_EVENT(ParseInitFailed, {
62  .severity = eSeverityInternal,
63  .id = "M0008",
64  .brief = "Failed to init parser",
65  .description = "The parser failed to initialise",
66 })
67 
68 CTU_EVENT(ScanFailed, {
69  .severity = eSeverityInternal,
70  .id = "M0009",
71  .brief = "Failed to scan",
72  .description = "The scanner failed to scan the source file due to internal errors",
73 })
74 
75 CTU_EVENT(ParseFailed, {
76  .severity = eSeverityFatal,
77  .id = "M0010",
78  .brief = "Failed to parse",
79  .description = "The parser failed to parse the source file",
80 })
81 
82 CTU_EVENT(ParseInternalError, {
83  .severity = eSeverityInternal,
84  .id = "M0011",
85  .brief = "Internal parser error",
86  .description = "The parser encountered an internal error",
87 })
88 
89 CTU_EVENT(UninitializedValueUsed, {
90  .severity = eSeverityFatal,
91  .id = "M0012",
92  .brief = "Uninitialized value used",
93  .description = "An uninitialized value was used in a compile time context",
94 })
95 
96 CTU_EVENT(DivideByZero, {
97  .severity = eSeverityFatal,
98  .id = "M0013",
99  .brief = "Divide by zero",
100  .description = "A divide by zero was encountered in a compile time context",
101 })
102 
103 CTU_EVENT(ModuloByZero, {
104  .severity = eSeverityFatal,
105  .id = "M0014",
106  .brief = "Modulo by zero",
107  .description = "A modulo by zero was encountered in a compile time context",
108 })
109 
110 CTU_EVENT(InvalidStringEscape, {
111  .severity = eSeverityFatal,
112  .id = "M0015",
113  .brief = "Invalid string escape",
114  .description = "An invalid string escape was encountered while parsing",
115 })
116 
117 CTU_EVENT(InvalidIntegerLiteral, {
118  .severity = eSeverityFatal,
119  .id = "M0016",
120  .brief = "Invalid integer literal",
121  .description = "An invalid integer literal was encountered while parsing",
122 })
123 
124 CTU_EVENT(SymbolShadowed, {
125  .severity = eSeverityFatal,
126  .id = "M0017",
127  .brief = "Symbol shadowed",
128  .description = "A symbol was shadowed by another symbol",
129 })
130 
131 CTU_EVENT(VariableNotFound, {
132  .severity = eSeverityFatal,
133  .id = "M0018",
134  .brief = "Variable not found",
135  .description = "A variable was not found in the current scope",
136 })
137 
138 CTU_EVENT(FunctionNotFound, {
139  .severity = eSeverityFatal,
140  .id = "M0019",
141  .brief = "Function not found",
142  .description = "A function was not found in the current scope",
143 })
144 
145 CTU_EVENT(TypeNotFound, {
146  .severity = eSeverityFatal,
147  .id = "M0020",
148  .brief = "Type not found",
149  .description = "A type was not found in the current scope",
150 })
151 
152 CTU_EVENT(FieldNotFound, {
153  .severity = eSeverityFatal,
154  .id = "M0021",
155  .brief = "Field not found",
156  .description = "A field was not found in within a type",
157 })
158 
159 CTU_EVENT(AttribNotFound, {
160  .severity = eSeverityWarn,
161  .id = "M0022",
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",
165 })
166 
167 CTU_EVENT(InvalidIndirection, {
168  .severity = eSeverityFatal,
169  .id = "M0023",
170  .brief = "Invalid indirection",
171  .description = "The wrong indirection was used when accessing a value",
172 })
173 
174 CTU_EVENT(InvalidIndex, {
175  .severity = eSeverityFatal,
176  .id = "M0024",
177  .brief = "Invalid index",
178  .description = "An indexing operation was invalid",
179 })
180 
181 CTU_EVENT(SymbolNotVisible, {
182  .severity = eSeverityFatal,
183  .id = "M0025",
184  .brief = "Symbol not visible",
185  .description = "A symbol was not visible in the current scope, perhaps due to privacy specifiers",
186 })
187 
188 CTU_EVENT(SymbolNotFound, {
189  .severity = eSeverityFatal,
190  .id = "M0026",
191  .brief = "Symbol not found",
192  .description = "A symbol was not found in the current scope",
193 })
194 
195 CTU_EVENT(MalformedTypeName, {
196  .severity = eSeverityFatal,
197  .id = "M0027",
198  .brief = "Malformed type name",
199  .description = "A type name was malformed and could not be resolved to a type",
200 })
201 
202 CTU_EVENT(MutationOfConst, {
203  .severity = eSeverityFatal,
204  .id = "M0028",
205  .brief = "Mutation of const",
206  .description = "A const value was mutated",
207 })
208 
209 CTU_EVENT(ExpressionHasNoEffect, {
210  .severity = eSeverityWarn,
211  .id = "M0029",
212  .brief = "Expression has no effect",
213  .description = "An expression has no effect",
214 })
215 
216 CTU_EVENT(IncorrectParamCount, {
217  .severity = eSeverityFatal,
218  .id = "M0030",
219  .brief = "Incorrect parameter count",
220  .description = "A function was called with an incorrect number of parameters",
221 })
222 
223 CTU_EVENT(IncorrectParamType, {
224  .severity = eSeverityFatal,
225  .id = "M0031",
226  .brief = "Incorrect parameter type",
227  .description = "A function was called with an incorrect parameter type",
228 })
229 
230 CTU_EVENT(DuplicateAttribute, {
231  .severity = eSeverityFatal,
232  .id = "M0032",
233  .brief = "Duplicate attribute",
234  .description = "A duplicate attribute was found on a declaration",
235 })
236 
237 CTU_EVENT(InvalidAttributeApplication, {
238  .severity = eSeverityFatal,
239  .id = "M0033",
240  .brief = "Invalid attribute application",
241  .description = "An attribute was applied to the incorrect kind of declaration",
242 })
243 
244 CTU_EVENT(MalformedAttribute, {
245  .severity = eSeverityFatal,
246  .id = "M0034",
247  .brief = "Malformed attribute",
248  .description = "An attribute or its arguments were malformed",
249 })
250 
251 CTU_EVENT(UnimplementedAttribute, {
252  .severity = eSeverityWarn,
253  .id = "M0035",
254  .brief = "Unimplemented attribute",
255  .description = "An attribute is not implemented",
256 })
257 
258 CTU_EVENT(InvalidLiteralType, {
259  .severity = eSeverityFatal,
260  .id = "M0036",
261  .brief = "Invalid literal type",
262  .description = "A literal was of an invalid type",
263 })
264 
265 CTU_EVENT(InvalidBinaryOperation, {
266  .severity = eSeverityFatal,
267  .id = "M0037",
268  .brief = "Invalid binary operation",
269  .description = "A binary operations operands were not compatible for the operation",
270 })
271 
272 CTU_EVENT(InvalidUnaryOperation, {
273  .severity = eSeverityFatal,
274  .id = "M0038",
275  .brief = "Invalid unary operation",
276  .description = "A unary operations operand was not compatible for the operation",
277 })
278 
279 CTU_EVENT(InvalidInitializer, {
280  .severity = eSeverityFatal,
281  .id = "M0039",
282  .brief = "Invalid initializer",
283  .description = "An aggregate initializer was invalid,"
284  " either due to an invalid field value or an ambiguous implicit type",
285 })
286 
287 CTU_EVENT(InvalidControlFlow, {
288  .severity = eSeverityFatal,
289  .id = "M0040",
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.",
293 })
294 
295 CTU_EVENT(CirclularImport, {
296  .severity = eSeverityFatal,
297  .id = "M0041",
298  .brief = "Circular import",
299  .description = "A translation unit imported itself, note that multural recursion between translation units is supported",
300 })
301 
302 CTU_EVENT(ImportNotFound, {
303  .severity = eSeverityFatal,
304  .id = "M0042",
305  .brief = "Import not found",
306  .description = "An import was unable to be resolved",
307 })
308 
309 CTU_EVENT(ImportShadowed, {
310  .severity = eSeverityFatal,
311  .id = "M0043",
312  .brief = "Import shadowed",
313  .description = "Importing an external translation units symbols would shadow an existing symbol in the current scope",
314 })
315 
316 CTU_EVENT(InvalidEnumUnderlyingType, {
317  .severity = eSeverityFatal,
318  .id = "M0044",
319  .brief = "Invalid enum underlying type",
320  .description = "The user specified underlying type of an enum was invalid",
321 })
322 
323 CTU_EVENT(DuplicateField, {
324  .severity = eSeverityFatal,
325  .id = "M0045",
326  .brief = "Duplicate field",
327  .description = "A duplicate field was found in an aggregate or enumeration",
328 })
329 
330 CTU_EVENT(InvalidFunctionSignature, {
331  .severity = eSeverityFatal,
332  .id = "M0046",
333  .brief = "Invalid function signature",
334  .description = "A function signature was invalid, parameters cannot be a unit type",
335 })
336 
337 CTU_EVENT(InvalidArraySize, {
338  .severity = eSeverityFatal,
339  .id = "M0047",
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",
343 })
344 
345 CTU_EVENT(InvalidVariableType, {
346  .severity = eSeverityFatal,
347  .id = "M0048",
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",
351 })
352 
353 CTU_EVENT(CyclicDependency, {
354  .severity = eSeverityFatal,
355  .id = "M0049",
356  .brief = "Cyclic dependency",
357  .description = "Static evaluation of a value encountered a cyclic dependency",
358 })
359 
360 CTU_EVENT(ImportedWithImpl, {
361  .severity = eSeverityFatal,
362  .id = "M0050",
363  .brief = "Imported declaration has implementation",
364  .description = "A declaration was imported but has a declaration with an implementation in the current translation unit",
365 })
366 
367 CTU_EVENT(EntryNotFunction, {
368  .severity = eSeverityFatal,
369  .id = "M0051",
370  .brief = "Entry not function",
371  .description = "The entry point of the program was not a function",
372 })
373 
374 CTU_EVENT(EntryMissingBody, {
375  .severity = eSeverityFatal,
376  .id = "M0052",
377  .brief = "Entry missing body",
378  .description = "The entry point of the program was missing an implementation",
379 })
380 
381 CTU_EVENT(MultipleEntryPoints, {
382  .severity = eSeverityFatal,
383  .id = "M0053",
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",
387 })
388 
389 CTU_EVENT(ReturnTypeMismatch, {
390  .severity = eSeverityFatal,
391  .id = "M0054",
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",
395 })
396 
397 CTU_EVENT(Deprecated, {
398  .severity = eSeverityWarn,
399  .id = "M0055",
400  .brief = "Deprecated",
401  .description = "A deprecated feature was used",
402 })
403 
404 CTU_EVENT(MayNotReturn, {
405  .severity = eSeverityFatal,
406  .id = "M0056",
407  .brief = "May not return",
408  .description = "A function with a return value may not always return a value",
409 })
410 
411 CTU_EVENT(RecursiveEval, {
412  .severity = eSeverityFatal,
413  .id = "M0057",
414  .brief = "Recursive eval",
415  .description = "Static evaluation of a value would recurse infinitely",
416 })
417 
418 CTU_EVENT(InfiniteSizedType, {
419  .severity = eSeverityFatal,
420  .id = "M0058",
421  .brief = "Infinite sized type",
422  .description = "A type was infinitely sized, indicating a recursive type",
423 })
424 
425 CTU_EVENT(InvalidType, {
426  .severity = eSeverityFatal,
427  .id = "M0059",
428  .brief = "Invalid type",
429  .description = "A type was invalid due to invalid recursion",
430 })
431 
432 CTU_EVENT(WorryingCast, {
433  .severity = eSeverityWarn,
434  .id = "M0061",
435  .brief = "Worrying cast",
436  .description = "A cast between types that may truncate, lose precision, or lose type information",
437 })
438 
439 CTU_EVENT(InvalidCast, {
440  .severity = eSeverityFatal,
441  .id = "M0060",
442  .brief = "Invalid cast",
443  .description = "A cast between types was invalid",
444 })
445 
446 CTU_EVENT(FailedToIdentifyLanguage, {
447  .severity = eSeverityFatal,
448  .id = "M0062",
449  .brief = "Failed to identify language",
450  .description = "The compiler was unable to identify the language of a source file",
451 })
452 
453 CTU_EVENT(IgnoredMangling, {
454  .severity = eSeverityWarn,
455  .id = "M0063",
456  .brief = "Ignored mangling",
457  .description = "A symbol with hidden linkage has a mangled name, which is ignored",
458 })
459 
460 CTU_EVENT(UnknownToken, {
461  .severity = eSeverityFatal,
462  .id = "M0064",
463  .brief = "Unknown token",
464  .description = "The scanner encountered an unknown token",
465 })
466 
467 CTU_EVENT(SyntaxError, {
468  .severity = eSeverityFatal,
469  .id = "M0065",
470  .brief = "Syntax error",
471  .description = "The parser encountered a syntax error",
472 })
473 
474 CTU_EVENT(SourceAndHeaderOutput, {
475  .severity = eSeverityFatal,
476  .id = "M0066",
477  .brief = "Source and header both need to be specified",
478  .description =
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",
481 })
482 
483 CTU_EVENT(ExactlyOneSourceFile, {
484  .severity = eSeverityFatal,
485  .id = "M0067",
486  .brief = "Tool expects exactly one source file",
487  .description =
488  "The tool expects exactly one source file, but multiple were provided",
489 })
490 
491 CTU_EVENT(CannotEvalExpression, {
492  .severity = eSeverityWarn,
493  .id = "M0068",
494  .brief = "Evaluation of an expression failed",
495  .description =
496  "The compiler was unable to evaluate an expression, "
497  "this may be due to an unsupported feature or a bug in the compiler.",
498 })
499 
500 CTU_EVENT(InexactIntegerDivision, {
501  .severity = eSeverityWarn,
502  .id = "M0069",
503  .brief = "Inexact integer division",
504  .description =
505  "An integer division was not exact, "
506  "This behaviour is not consistent between languages or compiler versions.",
507 })
508 
509 CTU_EVENT(ShiftByNegative, {
510  .severity = eSeverityFatal,
511  .id = "M0070",
512  .brief = "Shift by negative",
513  .description =
514  "A bit shift by a negative amount was encountered.",
515 })
516 
517 CTU_EVENT(IntegerOverflow, {
518  .severity = eSeverityFatal,
519  .id = "M0071",
520  .brief = "Integer overflow",
521  .description =
522  "An integer overflow was encountered.",
523 })
524 
525 CTU_EVENT(InvalidFloatLiteral, {
526  .severity = eSeverityFatal,
527  .id = "M0072",
528  .brief = "Invalid float literal",
529  .description =
530  "Invalid floating point literal value.",
531 })
532 
533 CTU_EVENT(InvalidFilePath, {
534  .severity = eSeverityFatal,
535  .id = "M0073",
536  .brief = "Invalid file path",
537  .description =
538  "The file path was invalid.",
539 })
540 
541 CTU_EVENT(ModuleConflict, {
542  .severity = eSeverityFatal,
543  .id = "M0074",
544  .brief = "Module conflict",
545  .description =
546  "A module with the same name already exists.",
547 })
548 
549 CTU_EVENT(LanguageDriverConflict, {
550  .severity = eSeverityFatal,
551  .id = "M0075",
552  .brief = "Language driver conflict",
553  .description =
554  "A language driver with the same name already exists.",
555 })
556 
557 CTU_EVENT(PluginConflict, {
558  .severity = eSeverityFatal,
559  .id = "M0076",
560  .brief = "Plugin conflict",
561  .description =
562  "A plugin with the same name already exists.",
563 })
564 
565 CTU_EVENT(TargetConflict, {
566  .severity = eSeverityFatal,
567  .id = "M0077",
568  .brief = "Target conflict",
569  .description =
570  "A target with the same name already exists.",
571 })
572 
573 CTU_EVENT(DynamicLoadingDisabled, {
574  .severity = eSeverityFatal,
575  .id = "M0078",
576  .brief = "Dynamic loading disabled",
577  .description =
578  "Dynamic loading is disabled in this distribution of cthulhu.",
579 })
580 
581 CTU_EVENT(Unimplemented, {
582  .severity = eSeveritySorry,
583  .id = "M0079",
584  .brief = "Unimplemented",
585  .description =
586  "This feature has not yet been implemented.",
587 })
588 
589 CTU_EVENT(CommandLineInvalid, {
590  .severity = eSeverityFatal,
591  .id = "M0080",
592  .brief = "Command line invalid",
593  .description =
594  "The command line arguments were invalid.",
595 })
596 
597 CTU_EVENT(InvalidTarget, {
598  .severity = eSeverityFatal,
599  .id = "M0081",
600  .brief = "Invalid target",
601  .description =
602  "The target was invalid.",
603 })
604 
605 CTU_EVENT(InvalidName, {
606  .severity = eSeverityInternal,
607  .id = "M0082",
608  .brief = "Invalid name",
609  .description =
610  "Non-anonymous symbol had an empty name.",
611 })
612 
613 CTU_EVENT(AssignToConst, {
614  .severity = eSeverityFatal,
615  .id = "M0083",
616  .brief = "Assign to const",
617  .description =
618  "A const value was assigned to.",
619 })
620 
621 CTU_EVENT(NotAnAggregate, {
622  .severity = eSeverityFatal,
623  .id = "M0084",
624  .brief = "Not an aggregate",
625  .description =
626  "A type was not an aggregate type.",
627 })
628 
629 CTU_EVENT(AssignToParam, {
630  .severity = eSeverityInternal,
631  .id = "M0085",
632  .brief = "Assign to param",
633  .description =
634  "A parameter was assigned to, if a frontend allows this it must create a local copy.",
635 })
636 
637 CTU_EVENT(InvalidAssignment, {
638  .severity = eSeverityFatal,
639  .id = "M0086",
640  .brief = "Invalid assignment",
641  .description =
642  "Source and destination types in assignment are incompatible.",
643 })
644 
645 #undef CTU_EVENT
#define CTU_EVENT(name,...)
Definition: events.inc:4