with Osint; use Osint;
with Sinput.L; use Sinput.L;
with Stylesw; use Stylesw;
-with Validsw; use Validsw;
with GNAT.Spelling_Checker; use GNAT.Spelling_Checker;
Save_Style_Checks : Style_Check_Options;
-- Save style check so it can be restored later
- Save_Validity_Check : Boolean;
- Save_Validity_Checks : Validity_Check_Options;
- -- Save validity check so it can be restored later
-
With_Cunit : Node_Id;
-- Compilation unit node for withed unit
Save_Style_Check_Options (Save_Style_Checks);
Save_Style_Check := Opt.Style_Check;
- Save_Validity_Check_Options (Save_Validity_Checks);
- Save_Validity_Check := Opt.Validity_Checks_On;
-
-- If main unit, set Main_Unit_Entity (this will get overwritten if
-- the main unit has a separate spec, that happens later on in Load)
or else Nkind (Unit (Curunit)) in N_Generic_Instantiation
or else Nkind (Unit (Curunit)) in N_Renaming_Declaration
then
- -- Turn style and validity checks off for parent unit
+ -- Turn style checks off for parent unit
if not GNAT_Mode then
Reset_Style_Check_Options;
- Reset_Validity_Check_Options;
end if;
Spec_Name := Get_Parent_Spec_Name (Unit_Name (Cur_Unum));
end if;
end if;
- -- Now we load with'ed units, with style/validity checks turned off
+ -- Now we load with'ed units, with style checks turned off
if not GNAT_Mode then
Reset_Style_Check_Options;
- Reset_Validity_Check_Options;
end if;
-- Load the context items in two rounds: the first round handles normal
Set_Style_Check_Options (Save_Style_Checks);
Opt.Style_Check := Save_Style_Check;
- Set_Validity_Check_Options (Save_Validity_Checks);
- Opt.Validity_Checks_On := Save_Validity_Check;
end Load;
begin
Validity_Check_Components := False;
Validity_Check_Copies := False;
- Validity_Check_Default := True;
+ Validity_Check_Default := False;
Validity_Check_Floating_Point := False;
Validity_Check_In_Out_Params := False;
Validity_Check_In_Params := False;
Validity_Check_Operands := False;
+ Validity_Check_Parameters := False;
Validity_Check_Returns := False;
Validity_Check_Subscripts := False;
Validity_Check_Tests := False;
Options (K) := ' ';
end loop;
- Add ('n', not Validity_Check_Default);
-
- Add ('c', Validity_Check_Copies);
Add ('e', Validity_Check_Components);
+ Add ('c', Validity_Check_Copies);
+ Add ('d', Validity_Check_Default);
Add ('f', Validity_Check_Floating_Point);
Add ('i', Validity_Check_In_Params);
Add ('m', Validity_Check_In_Out_Params);
Add ('o', Validity_Check_Operands);
+ Add ('p', Validity_Check_Parameters);
Add ('r', Validity_Check_Returns);
Add ('s', Validity_Check_Subscripts);
Add ('t', Validity_Check_Tests);
-- or in the argument of a Validity_Checks pragma to activate the option.
-- The corresponding upper case letter deactivates the option.
+ Validity_Check_Components : Boolean := False;
+ -- Controls validity checking for assignment to elementary components of
+ -- records. If this switch is set to True using -gnatVe, or an 'e' in the
+ -- argument of Validity_Checks pragma, then the right-hand side of an
+ -- assignment to such a component is checked for validity.
+
Validity_Check_Copies : Boolean := False;
-- Controls the validity checking of copies. If this switch is set to
- -- true using -gnatVc, or a 'c' in the argument of a Validity_Checks
- -- pragma, then the right side of assignments and also initializing
+ -- True using -gnatVc, or a 'c' in the argument of a Validity_Checks
+ -- pragma, then the right-hand side of assignments and also initializing
-- expressions in object declarations are checked for validity.
- Validity_Check_Components : Boolean := False;
- -- Controls validity checking for assignment to elementary components of
- -- records. If this switch is set true using -gnatVe, or an 'e' in the
- -- argument of Validity_Checks pragma, then the right hand of an assignment
- -- to such a component is checked for validity.
-
Validity_Check_Default : Boolean := True;
-- Controls default (reference manual) validity checking. If this switch is
-- set to True using -gnatVd or a 'd' in the argument of a Validity_Checks
- -- pragma (or the initial default value is used, set True), then left side
- -- subscripts and case statement arguments are checked for validity. This
- -- switch is also set by default if no -gnatV switch is used and no
+ -- pragma (or the initial default value is used, set True), then left-hand
+ -- side subscripts and case statement arguments are checked for validity.
+ -- This switch is also set by default if no -gnatV switch is used and no
-- Validity_Checks pragma is processed.
Validity_Check_Floating_Point : Boolean := False;
- -- Normally validity checking applies only to discrete values (integer
- -- and enumeration types). If this switch is set to True using -gnatVf
- -- or an 'f' in the argument of a Validity_Checks pragma, then floating-
- -- point values are also checked. The context in which such checks
- -- occur depends on other flags, e.g. if Validity_Check_Copies is also
- -- set then floating-point values on the right side of an assignment
+ -- Normally validity checking applies only to discrete values (integer and
+ -- enumeration types). If this switch is set to True using -gnatVf or an
+ -- 'f' in the argument of a Validity_Checks pragma, then floating-point
+ -- values are also checked. If the context in which such checks occur
+ -- depends on other flags, e.g. if Validity_Check_Copies is also set,
+ -- then floating-point values on the right-hand side of an assignment
-- will be validity checked.
Validity_Check_In_Out_Params : Boolean := False;
-- pragma, then the expression in a RETURN statement is validity checked.
Validity_Check_Subscripts : Boolean := False;
- -- Controls validity checking of subscripts. If this switch is set to
- -- True using -gnatVs, or an 's' in the argument of a Validity_Checks
- -- pragma, then all subscripts are checked for validity. Note that left
- -- side subscript checking is controlled also by Validity_Check_Default.
- -- If Validity_Check_Subscripts is True, then all subscripts are checked,
- -- otherwise if Validity_Check_Default is True, then left side subscripts
- -- are checked, otherwise no subscripts are checked.
+ -- Controls validity checking of subscripts. If this switch is set to True
+ -- using -gnatVs, or an 's' in the argument of a Validity_Checks pragma,
+ -- then all subscripts are checked for validity. Note that left-hand side
+ -- subscript checking is also controlled by Validity_Check_Default. If
+ -- Validity_Check_Subscripts is True, then all subscripts are checked,
+ -- otherwise if Validity_Check_Default is True, then left-hand side
+ -- subscripts are checked; otherwise no subscripts are checked.
Validity_Check_Tests : Boolean := False;
-- Controls validity checking of tests that occur in conditions (i.e. the