1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2001-2023, Free Software Foundation, Inc. --
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. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
27 with Output
; use Output
;
29 package body Validsw
is
31 ----------------------------------
32 -- Reset_Validity_Check_Options --
33 ----------------------------------
35 procedure Reset_Validity_Check_Options
is
37 Validity_Check_Components
:= False;
38 Validity_Check_Copies
:= False;
39 Validity_Check_Default
:= False;
40 Validity_Check_Floating_Point
:= False;
41 Validity_Check_In_Out_Params
:= False;
42 Validity_Check_In_Params
:= False;
43 Validity_Check_Operands
:= False;
44 Validity_Check_Parameters
:= False;
45 Validity_Check_Returns
:= False;
46 Validity_Check_Subscripts
:= False;
47 Validity_Check_Tests
:= False;
48 end Reset_Validity_Check_Options
;
50 --------------------------------
51 -- Set_Validity_Check_Options --
52 --------------------------------
54 -- Version used when no error checking is required
56 procedure Set_Validity_Check_Options
(Options
: String) is
59 pragma Warnings
(Off
, OK
);
60 pragma Warnings
(Off
, EC
);
62 Set_Validity_Check_Options
(Options
, OK
, EC
);
63 end Set_Validity_Check_Options
;
65 -- Normal version with error checking
67 procedure Set_Validity_Check_Options
70 Err_Col
: out Natural)
77 while J
<= Options
'Last loop
81 -- Turn on validity checking (gets turned off by Vn)
83 Validity_Checks_On
:= True;
87 Validity_Check_Copies
:= True;
90 Validity_Check_Default
:= True;
93 Validity_Check_Components
:= True;
96 Validity_Check_Floating_Point
:= True;
99 Validity_Check_In_Params
:= True;
102 Validity_Check_In_Out_Params
:= True;
105 Validity_Check_Operands
:= True;
108 Validity_Check_Parameters
:= True;
111 Validity_Check_Returns
:= True;
114 Validity_Check_Subscripts
:= True;
117 Validity_Check_Tests
:= True;
120 Validity_Check_Copies
:= False;
123 Validity_Check_Default
:= False;
126 Validity_Check_Components
:= False;
129 Validity_Check_Floating_Point
:= False;
132 Validity_Check_In_Params
:= False;
135 Validity_Check_In_Out_Params
:= False;
138 Validity_Check_Operands
:= False;
141 Validity_Check_Parameters
:= False;
144 Validity_Check_Returns
:= False;
147 Validity_Check_Subscripts
:= False;
150 Validity_Check_Tests
:= False;
153 Validity_Check_Components
:= True;
154 Validity_Check_Copies
:= True;
155 Validity_Check_Default
:= True;
156 Validity_Check_Floating_Point
:= True;
157 Validity_Check_In_Out_Params
:= True;
158 Validity_Check_In_Params
:= True;
159 Validity_Check_Operands
:= True;
160 Validity_Check_Parameters
:= True;
161 Validity_Check_Returns
:= True;
162 Validity_Check_Subscripts
:= True;
163 Validity_Check_Tests
:= True;
166 Validity_Check_Components
:= False;
167 Validity_Check_Copies
:= False;
168 Validity_Check_Default
:= False;
169 Validity_Check_Floating_Point
:= False;
170 Validity_Check_In_Out_Params
:= False;
171 Validity_Check_In_Params
:= False;
172 Validity_Check_Operands
:= False;
173 Validity_Check_Parameters
:= False;
174 Validity_Check_Returns
:= False;
175 Validity_Check_Subscripts
:= False;
176 Validity_Check_Tests
:= False;
177 Validity_Checks_On
:= False;
183 if Ignore_Unrecognized_VWY_Switches
then
184 Write_Line
("unrecognized switch -gnatV" & C
& " ignored");
194 Err_Col
:= Options
'Last + 1;
195 end Set_Validity_Check_Options
;