Debian Codegraph @

gcc/ada/diagnostics-repository.ads

raw
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- D I A G N O S T I C S . R E P O S I T O R Y --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2025, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
20 -- --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
23 -- --
24 ------------------------------------------------------------------------------
25 package Diagnostics.Repository is
26
27 type Diagnostics_Registry_Type is
28 array (Diagnostic_Id) of Diagnostic_Entry_Type;
29
30 -- Include the diagnostic entries for every diagnostic id.
31 -- The entries should include:
32 -- * Whether the diagnostic with this id is active or not
33 -- * The human-readable name for the diagnostic for SARIF reports
34 -- * The switch id for the diagnostic if the diagnostic is linked to any
35 -- compiler switch
36 -- * The documentation file for the diagnostic written in the MD format.
37 -- The documentation file should include:
38 -- - The diagnostic id
39 -- - A short description of the diagnostic
40 -- - A minimal example of the code that triggers the diagnostic
41 -- - An explanation of why the diagnostic was triggered
42 -- - A suggestion on how to fix the issue
43 -- - Optionally additional information
44 -- TODO: the mandatory fields for the documentation file could be changed
45
46 Diagnostic_Entries : Diagnostics_Registry_Type :=
47 (No_Diagnostic_Id => (others => <>),
48 GNAT0001 =>
49 (Status => Active,
50 Human_Id => new String'("Default_Iterator_Not_Primitive_Error"),
51 Documentation => new String'("./error_codes/GNAT0001.md"),
52 Switch => No_Switch_Id),
53 GNAT0002 =>
54 (Status => Active,
55 Human_Id =>
56 new String'("Invalid_Operand_Types_For_Operator_Error"),
57 Documentation => new String'("./error_codes/GNAT0002.md"),
58 Switch => No_Switch_Id),
59 GNAT0003 =>
60 (Status => Active,
61 Human_Id =>
62 new String'("Invalid_Operand_Types_Left_To_Int_Error"),
63 Documentation => new String'("./error_codes/GNAT0003.md"),
64 Switch => No_Switch_Id),
65 GNAT0004 =>
66 (Status => Active,
67 Human_Id =>
68 new String'("Invalid_Operand_Types_Right_To_Int_Error"),
69 Documentation => new String'("./error_codes/GNAT0004.md"),
70 Switch => No_Switch_Id),
71 GNAT0005 =>
72 (Status => Active,
73 Human_Id =>
74 new String'("Invalid_Operand_Types_Left_Acc_Error"),
75 Documentation => new String'("./error_codes/GNAT0005.md"),
76 Switch => No_Switch_Id),
77 GNAT0006 =>
78 (Status => Active,
79 Human_Id =>
80 new String'("Invalid_Operand_Types_Right_Acc_Error"),
81 Documentation => new String'("./error_codes/GNAT0006.md"),
82 Switch => No_Switch_Id),
83 GNAT0007 =>
84 (Status => Active,
85 Human_Id =>
86 new String'("Invalid_Operand_Types_General_Error"),
87 Documentation => new String'("./error_codes/GNAT0007.md"),
88 Switch => No_Switch_Id),
89 GNAT0008 =>
90 (Status => Active,
91 Human_Id =>
92 new String'("Pragma_No_Effect_With_Lock_Free_Warning"),
93 Documentation => new String'("./error_codes/GNAT0008.md"),
94 Switch => No_Switch_Id),
95 GNAT0009 =>
96 (Status => Active,
97 Human_Id => new String'("End_Loop_Expected_Error"),
98 Documentation => new String'("./error_codes/GNAT0009.md"),
99 Switch => No_Switch_Id),
100 GNAT0010 =>
101 (Status => Active,
102 Human_Id => new String'("Representation_Too_Late_Error"),
103 Documentation => new String'("./error_codes/GNAT0010.md"),
104 Switch => No_Switch_Id),
105 GNAT0011 =>
106 (Status => Active,
107 Human_Id => new String'("Mixed_Container_Aggregate_Error"),
108 Documentation => new String'("./error_codes/GNAT0011.md"),
109 Switch => No_Switch_Id));
110
111 procedure Print_Diagnostic_Repository;
112
113 end Diagnostics.Repository;