-- --
-- S p e c --
-- --
--- --
--- Copyright (C) 2001 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- pragma, then the right 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 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 Validity_Checks pragma is processed.
+ -- 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
+ -- Validity_Checks pragma is processed.
Validity_Check_Floating_Point : Boolean := False;
-- Normally validity checking applies only to discrete values (integer
-- Controls the validity checking of IN OUT parameters. If this switch
-- is set to True using -gnatVm or a 'm' in the argument of a pragma
-- Validity_Checks, then the initial value of all IN OUT parameters
- -- will be checked at the point of call of a procecure. Note that the
+ -- will be checked at the point of call of a procedure. Note that the
-- character 'm' here stands for modified (parameters).
Validity_Check_In_Params : Boolean := False;
-- Controls the validity checking of IN parameters. If this switch is
-- set to True using -gnatVm or an 'i' in the argument of a pragma
-- Validity_Checks, then the initial value of all IN parameters
- -- will be checked at the point of call of a procecure or function.
+ -- will be checked at the point of call of a procedure or function.
Validity_Check_Operands : Boolean := False;
-- Controls validity checking of operands. If this switch is set to
-- pragma, then operands of all predefined operators and attributes
-- will be validity checked.
+ Validity_Check_Parameters : Boolean := False;
+ -- This controls validity treatment for parameters within a subprogram.
+ -- Normally if validity checking is enabled for parameters on a call
+ -- (Validity_Check_In[_Out]_Params) then an assumption is made that the
+ -- parameter values are valid on entry and not checked again within a
+ -- procedure. Setting Validity_Check_Parameters removes this assumption
+ -- and ensures that no assumptions are made about parameters, so that
+ -- they will always be checked.
+
Validity_Check_Returns : Boolean := False;
-- Controls validity checking of returned values. If this switch is set
-- to True using -gnatVr, or an 'r' in the argument of a Validity_Checks
-- switch is set to True using -gnatVt, or a 't' in the argument of a
-- Validity_Checks pragma, then all such conditions are validity checked.
+ Force_Validity_Checks : Boolean := False;
+ -- Normally, operands that do not come from source (i.e. cases of expander
+ -- generated code) are not checked, if this flag is set True, then checking
+ -- of such operands is forced (if Validity_Check_Operands is set).
+
-----------------
-- Subprograms --
-----------------
procedure Set_Validity_Check_Options (Options : String);
-- Like the above procedure, except that the call is simply ignored if
- -- there are any error conditions, this is for example appopriate for
+ -- there are any error conditions, this is for example appropriate for
-- calls where the string is known to be valid, e.g. because it was
-- obtained by Save_Validity_Check_Options.